Re: [PATCH 1/6] [RS6000] rs6000_output_call for external call insn assembly output

2018-11-08 Thread Alan Modra
On Wed, Nov 07, 2018 at 06:08:33PM -0600, Segher Boessenkool wrote: > On Wed, Nov 07, 2018 at 04:07:15PM +1030, Alan Modra wrote: > > +extern const char *rs6000_output_call (rtx *, unsigned int, bool, const > > char *); > > Maybe have a separate rs6000_output_call and

[PATCH 6/6] [RS6000] inline plt call sequences

2018-11-06 Thread Alan Modra
0_speculate_indirect_jumps") - (const_int 0)) - (const_string "12") - (const_string "4")) - (if_then_else (eq (symbol_ref "rs6000_speculate_indirect_jumps") - (const_int 0)) - (const_string

[PATCH 5/6] [RS6000] Use standard call patterns for __tls_get_addr calls

2018-11-06 Thread Alan Modra
*call_nonlocal_sysv" #if TARGET_MACHO return macho_output_call(insn, operands, 0, 2); #else - return rs6000_output_call (operands, 0, false, ""); + return rs6000_output_call (operands, 0, false); #endif } "DEFAULT_ABI == ABI_V4 @@ -10605,7 +10471,7 @@ (define_insn "*call_nonlocal_sysv_secure" else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS) output_asm_insn ("creqv 6,6,6", operands); - return rs6000_output_call (operands, 0, false, ""); + return rs6000_output_call (operands, 0, false); } [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10659,7 +10525,7 @@ (define_insn_and_split "*call_value_nonlocal_sysv" #if TARGET_MACHO return macho_output_call(insn, operands, 1, 3); #else - return rs6000_output_call (operands, 1, false, ""); + return rs6000_output_call (operands, 1, false); #endif } "DEFAULT_ABI == ABI_V4 @@ -10694,7 +10560,7 @@ (define_insn "*call_value_nonlocal_sysv_secure" else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS) output_asm_insn ("creqv 6,6,6", operands); - return rs6000_output_call (operands, 1, false, ""); + return rs6000_output_call (operands, 1, false); } [(set_attr "type" "branch,branch") (set_attr "length" "4,8")]) @@ -10728,7 +10594,7 @@ (define_insn "*call_nonlocal_aix" (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" { - return rs6000_output_call (operands, 0, false, ""); + return rs6000_output_call (operands, 0, false); } [(set_attr "type" "branch") (set_attr "length" "8")]) @@ -10740,7 +10606,7 @@ (define_insn "*call_value_nonlocal_aix" (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" { - return rs6000_output_call (operands, 1, false, ""); + return rs6000_output_call (operands, 1, false); } [(set_attr "type" "branch") (set_attr "length" "8")]) @@ -10991,7 +10857,7 @@ (define_insn "*sibcall_nonlocal_sysv" if (which_alternative >= 2) return rs6000_output_indirect_call (operands, 0, true); else -return rs6000_output_call (operands, 0, true, ""); +return rs6000_output_call (operands, 0, true); } [(set_attr "type" "branch") (set_attr_alternative "length" @@ -11031,7 +10897,7 @@ (define_insn "*sibcall_value_nonlocal_sysv" return "crset 2\;beq%T1-\;b $"; } else -return rs6000_output_call (operands, 1, true, ""); +return rs6000_output_call (operands, 1, true); } [(set_attr "type" "branch") (set_attr_alternative "length" @@ -11055,7 +10921,7 @@ (define_insn "*sibcall_aix" "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" { if (which_alternative == 0) -return rs6000_output_call (operands, 0, true, ""); +return rs6000_output_call (operands, 0, true); else return "b%T0"; } @@ -11069,7 +10935,7 @@ (define_insn "*sibcall_value_aix" "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" { if (which_alternative == 0) -return rs6000_output_call (operands, 1, true, ""); +return rs6000_output_call (operands, 1, true); else return "b%T1"; } -- Alan Modra Australia Development Lab, IBM

[PATCH 4/6] [RS6000] Remove constraints on call rounded_stack_size_rtx arg

2018-11-06 Thread Alan Modra
ix" (define_insn "*call_indirect_elfv2" [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l")) -(match_operand 1 "" "g,g")) +(match_operand 1)) (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 2 "const_int_operand" "n,n")] UNSPEC_TOCSLOT)) (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_ELFv2" @@ -10808,7 +10808,7 @@ (define_insn "*call_indirect_elfv2" (define_insn "*call_value_indirect_elfv2" [(set (match_operand 0 "" "") (call (mem:SI (match_operand:P 1 "register_operand" "c,*l")) - (match_operand 2 "" "g,g"))) + (match_operand 2))) (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 3 "const_int_operand" "n,n")] UNSPEC_TOCSLOT)) (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_ELFv2" @@ -10901,7 +10901,7 @@ (define_expand "sibcall_value" (define_insn "*sibcall_local32" [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s")) -(match_operand 1 "" "g,g")) +(match_operand 1)) (use (match_operand:SI 2 "immediate_operand" "O,n")) (simple_return)] "(INTVAL (operands[2]) & CALL_LONG) == 0" @@ -10919,7 +10919,7 @@ (define_insn "*sibcall_local32" (define_insn "*sibcall_local64" [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s")) -(match_operand 1 "" "g,g")) +(match_operand 1)) (use (match_operand:SI 2 "immediate_operand" "O,n")) (simple_return)] "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0" @@ -10938,7 +10938,7 @@ (define_insn "*sibcall_local64" (define_insn "*sibcall_value_local32" [(set (match_operand 0 "" "") (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s")) - (match_operand 2 "" "g,g"))) + (match_operand 2))) (use (match_operand:SI 3 "immediate_operand" "O,n")) (simple_return)] "(INTVAL (operands[3]) & CALL_LONG) == 0" @@ -10957,7 +10957,7 @@ (define_insn "*sibcall_value_local32" (define_insn "*sibcall_value_local64" [(set (match_operand 0 "" "") (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s")) - (match_operand 2 "" "g,g"))) + (match_operand 2))) (use (match_operand:SI 3 "immediate_operand" "O,n")) (simple_return)] "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0" @@ -11050,7 +11050,7 @@ (define_insn "*sibcall_value_nonlocal_sysv" (define_insn "*sibcall_aix" [(call (mem:SI (match_operand:P 0 "call_operand" "s,c")) -(match_operand 1 "" "g,g")) +(match_operand 1)) (simple_return)] "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" { @@ -11064,7 +11064,7 @@ (define_insn "*sibcall_aix" (define_insn "*sibcall_value_aix" [(set (match_operand 0 "" "") (call (mem:SI (match_operand:P 1 "call_operand" "s,c")) - (match_operand 2 "" "g,g"))) + (match_operand 2))) (simple_return)] "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" { -- Alan Modra Australia Development Lab, IBM

[PATCH 3/6] [RS6000] Replace TLSmode with P, and correct tls call mems

2018-11-06 Thread Alan Modra
UNSPEC_TLSTPRELHA))] +(define_insn "tls_tprel_ha_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTPRELHA))] "HAVE_AS_TLS" "addis %0,%1,%2@tprel@ha") -(define_insn "tls_tprel_lo_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") -(match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSTPRELLO))] +(define_insn "tls_tprel_lo_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTPRELLO))] "HAVE_AS_TLS" "addi %0,%1,%2@tprel@l") ;; "b" output constraint here and on tls_tls input to support linker tls ;; optimization. The linker may edit the instructions emitted by a ;; tls_got_tprel/tls_tls pair to addis,addi. -(define_insn_and_split "tls_got_tprel_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") -(match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTTPREL))] +(define_insn_and_split "tls_got_tprel_" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTTPREL))] "HAVE_AS_TLS" - "l %0,%2@got@tprel(%1)" + "l %0,%2@got@tprel(%1)" "&& TARGET_CMODEL != CMODEL_SMALL" [(set (match_dup 3) - (high:TLSmode - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL))) + (high:P + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL))) (set (match_dup 0) - (lo_sum:TLSmode (match_dup 3) - (unspec:TLSmode [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL)))] + (lo_sum:P (match_dup 3) + (unspec:P [(match_dup 1) (match_dup 2)] UNSPEC_TLSGOTTPREL)))] { operands[3] = gen_reg_rtx (TARGET_64BIT ? DImode : SImode); } [(set (attr "length") (if_then_else (ne (symbol_ref "TARGET_CMODEL") (symbol_ref "CMODEL_SMALL")) - (const_int 8) - (const_int 4)))]) - -(define_insn "*tls_got_tprel_high" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=b") - (high:TLSmode - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSGOTTPREL)))] + (const_int 8) + (const_int 4)))]) + +(define_insn "*tls_got_tprel_high" + [(set (match_operand:P 0 "gpc_reg_operand" "=b") + (high:P + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] +UNSPEC_TLSGOTTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" "addis %0,%1,%2@got@tprel@ha") -(define_insn "*tls_got_tprel_low" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (lo_sum:TLSmode (match_operand:TLSmode 1 "gpc_reg_operand" "b") -(unspec:TLSmode [(match_operand:TLSmode 3 "gpc_reg_operand" "b") - (match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] -UNSPEC_TLSGOTTPREL)))] +(define_insn "*tls_got_tprel_low" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (lo_sum:P (match_operand:P 1 "gpc_reg_operand" "b") +(unspec:P [(match_operand:P 3 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSGOTTPREL)))] "HAVE_AS_TLS && TARGET_CMODEL != CMODEL_SMALL" - "l %0,%2@got@tprel@l(%1)") + "l %0,%2@got@tprel@l(%1)") -(define_insn "tls_tls_" - [(set (match_operand:TLSmode 0 "gpc_reg_operand" "=r") - (unspec:TLSmode [(match_operand:TLSmode 1 "gpc_reg_operand" "b") -(match_operand:TLSmode 2 "rs6000_tls_symbol_ref" "")] - UNSPEC_TLSTLS))] +(define_insn "tls_tls_" + [(set (match_operand:P 0 "gpc_reg_operand" "=r") + (unspec:P [(match_operand:P 1 "gpc_reg_operand" "b") + (match_operand:P 2 "rs6000_tls_symbol_ref" "")] + UNSPEC_TLSTLS))] "TARGET_ELF && HAVE_AS_TLS" "add %0,%1,%2@tls") -- Alan Modra Australia Development Lab, IBM

[PATCH 2/6] [RS6000] rs6000_output_indirect_call

2018-11-06 Thread Alan Modra
quot;DEFAULT_ABI == ABI_ELFv2 && rs6000_speculate_indirect_jumps" - "b%T1l\; 2,%3(1)" - [(set_attr "type" "jmpreg") - (set_attr "length" "8")]) - -; Variant with deliberate misprediction. -(define_insn "*call_value_indirect_elfv2_nospec" - [(set (match_operand 0 "" "") - (call (mem:SI (match_operand:P 1 "register_operand" "c,*l")) - (match_operand 2 "" "g,g"))) - (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 3 "const_int_operand" "n,n")] UNSPEC_TOCSLOT)) - (clobber (reg:P LR_REGNO))] - "DEFAULT_ABI == ABI_ELFv2 && !rs6000_speculate_indirect_jumps" - "crset 2\;beq%T1l-\; 2,%3(1)" + "DEFAULT_ABI == ABI_ELFv2" +{ + return rs6000_output_indirect_call (operands, 1, false); +} [(set_attr "type" "jmpreg") - (set_attr "length" "12")]) + (set (attr "length") + (if_then_else (and (match_test "!rs6000_speculate_indirect_jumps") + (match_test "which_alternative != 1")) + (const_string "12") + (const_string "8")))]) ;; Call subroutine returning any type. (define_expand "untyped_call" @@ -11020,13 +10990,7 @@ (define_insn "*sibcall_nonlocal_sysv" output_asm_insn ("creqv 6,6,6", operands); if (which_alternative >= 2) -{ - if (rs6000_speculate_indirect_jumps) - return "b%T0"; - else - /* Can use CR0 since it is volatile across sibcalls. */ - return "crset 2\;beq%T0-\;b $"; -} +return rs6000_output_indirect_call (operands, 0, true); else return rs6000_output_call (operands, 0, true, ""); } -- Alan Modra Australia Development Lab, IBM

[PATCH 1/6] [RS6000] rs6000_output_call for external call insn assembly output

2018-11-06 Thread Alan Modra
l_nonlocal_sysv" /* Can use CR0 since it is volatile across sibcalls. */ return "crset 2\;beq%T0-\;b $"; } - else if (DEFAULT_ABI == ABI_V4 && flag_pic) -{ - gcc_assert (!TARGET_SECURE_PLT); - return "b %z0@plt"; -} else -return "b %z0"; +return rs6000_output_call (operands, 0, true, ""); } [(set_attr "type" "branch") (set_attr_alternative "length" @@ -11109,13 +11067,8 @@ (define_insn "*sibcall_value_nonlocal_sysv" /* Can use CR0 since it is volatile across sibcalls. */ return "crset 2\;beq%T1-\;b $"; } - else if (DEFAULT_ABI == ABI_V4 && flag_pic) -{ - gcc_assert (!TARGET_SECURE_PLT); - return "b %z1@plt"; -} else -return "b %z1"; +return rs6000_output_call (operands, 1, true, ""); } [(set_attr "type" "branch") (set_attr_alternative "length" @@ -11137,9 +11090,12 @@ (define_insn "*sibcall_aix" (match_operand 1 "" "g,g")) (simple_return)] "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" - "@ - b %z0 - b%T0" +{ + if (which_alternative == 0) +return rs6000_output_call (operands, 0, true, ""); + else +return "b%T0"; +} [(set_attr "type" "branch")]) (define_insn "*sibcall_value_aix" @@ -11148,9 +11104,12 @@ (define_insn "*sibcall_value_aix" (match_operand 2 "" "g,g"))) (simple_return)] "DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2" - "@ - b %z1 - b%T1" +{ + if (which_alternative == 0) +return rs6000_output_call (operands, 1, true, ""); + else +return "b%T1"; +} [(set_attr "type" "branch")]) (define_expand "sibcall_epilogue" -- Alan Modra Australia Development Lab, IBM

[PATCH 0/6] [RS6000] inline plt call support

2018-11-06 Thread Alan Modra
to support -mlongcall. This allows lazy dynamic resolution of the plt entries so it is now possible to dlopen libraries and have -mlongcall code call functions in those libraries. That wasn't possible before. See https://bugzilla.redhat.com/show_bug.cgi?id=1633721 Alan Modra (6): [RS6000] rs6000_o

Re: [PATCH, d] Disable D on systems where it is known not to work.

2018-10-30 Thread Alan Modra
h.d:242:5: error: static assert "Only 64-bit, 80-bit, and 128-bit reals are supported for LittleEndian CPUs" 242 | static assert(real.mant_dig == 53 || real.mant_dig == 64 | ^ -- Alan Modra Australia Development Lab, IBM

Re: libffi PowerPC64 ELFv1 fp arg fixes

2018-05-04 Thread Alan Modra
On Fri, May 04, 2018 at 06:02:27AM -0500, Segher Boessenkool wrote: > On Fri, May 04, 2018 at 07:40:20PM +0930, Alan Modra wrote: > > The attached patch has been accepted into upstream libffi. It fixes > > powerpc64-linux problems shown up by Bruno Haible's new libffi >

libffi PowerPC64 ELFv1 fp arg fixes

2018-05-04 Thread Alan Modra
The attached patch has been accepted into upstream libffi. It fixes powerpc64-linux problems shown up by Bruno Haible's new libffi testsuite tests. Bootstrapped and regression tested powerpc64-linux and powerpc64le-linux. OK mainline and active branches? -- Alan Modra Australia Development

Re: ATTRIBUTE_NONSTRING

2018-04-28 Thread Alan Modra
On Fri, Apr 27, 2018 at 06:24:28PM -0400, Hans-Peter Nilsson wrote: > On Fri, 27 Apr 2018, Alan Modra wrote: > > > This patch adds ATTRIBUTE_NONSTRING, which will be used to curb > > -Wstringop-truncation warnings in binutils. OK to apply? > > > > * ansidecl.h

Re: PR85532, crtend.o built without --enable-initfini-array has bad .eh_frame

2018-04-27 Thread Alan Modra
On Fri, Apr 27, 2018 at 09:31:37AM +0200, Jakub Jelinek wrote: > On Fri, Apr 27, 2018 at 02:27:40AM -0500, Segher Boessenkool wrote: > > Hi Alan, > > > > On Fri, Apr 27, 2018 at 10:49:14AM +0930, Alan Modra wrote: > > > This patch is aimed at removing bogu

ATTRIBUTE_NONSTRING

2018-04-26 Thread Alan Modra
= 8000 +# define ATTRIBUTE_NONSTRING __attribute__ ((nonstring)) +# else +# define ATTRIBUTE_NONSTRING +# endif +#endif + /* We use __extension__ in some places to suppress -pedantic warnings about GCC extensions. This feature didn't work properly before gcc 2.8. */ -- Alan Modra Aus

PR85532, crtend.o built without --enable-initfini-array has bad .eh_frame

2018-04-26 Thread Alan Modra
after libgcc.a. See PR45053. -CRTSTUFF_T_CFLAGS = -msdata=none -O2 +CRTSTUFF_T_CFLAGS = -msdata=none -O2 -fno-asynchronous-unwind-tables -- Alan Modra Australia Development Lab, IBM

Re: [PATCH][GCC][mid-end] Fix PR85123 incorrect copies

2018-04-05 Thread Alan Modra
0 | 0 | s0 | s1 | | s2 | s3 | s4 | s5 | ~~~ ~~~ So we will have xbitpos=16 first time around the loop. That means your new code will attempt to store 32 bits into a bit-field starting at bit 16 in the first 32-bit register,

Re: [PATCH][GCC][mid-end] Allow larger copies when target supports unaligned access [Patch (1/2)]

2018-04-03 Thread Alan Modra
On Tue, Apr 03, 2018 at 02:30:23PM +0200, Richard Biener wrote: > On Tue, 3 Apr 2018, Alan Modra wrote: > > > On Tue, Apr 03, 2018 at 01:01:23PM +0200, Richard Biener wrote: > > > On Fri, 30 Mar 2018, Peter Bergner wrote: > > > > > > > On 3/29/18 9:35 A

Re: [PATCH][GCC][mid-end] Allow larger copies when target supports unaligned access [Patch (1/2)]

2018-04-03 Thread Alan Modra
On Tue, Apr 03, 2018 at 01:01:23PM +0200, Richard Biener wrote: > On Fri, 30 Mar 2018, Peter Bergner wrote: > > > On 3/29/18 9:35 AM, Alan Modra wrote: > > > On Thu, Nov 16, 2017 at 03:27:01PM +, Tamar Christina wrote: > > >> --- a/gcc/expr.c > > >&g

Re: [PATCH][GCC][mid-end] Allow larger copies when target supports unaligned access [Patch (1/2)]

2018-03-29 Thread Alan Modra
acted bit-field can exceed the source size. That will result in rubbish being read into a register. -- Alan Modra Australia Development Lab, IBM

gcc testsuite changes for new linker messages

2018-02-27 Thread Alan Modra
ll "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text regsub -all "(^|\n)\[^\n\]*: . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text -- Alan Modra Australia Development Lab, IBM

Re: PR84300, ICE in dwarf2cfi on ppc64le

2018-02-09 Thread Alan Modra
On Fri, Feb 09, 2018 at 08:11:44AM -0600, Segher Boessenkool wrote: > On Fri, Feb 09, 2018 at 04:12:47PM +1030, Alan Modra wrote: > > ;; Use r0 to stop regrename twiddling with lr restore insns emitted > > ;; after the call to __morestack. > > (define_ins

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-09 Thread Alan Modra
On Fri, Feb 09, 2018 at 08:34:08AM -0200, Alexandre Oliva wrote: > * config/rs6000/rs6000.md (blockage): Set length to zero. Thanks! This fixed the ppc64le libdecnumber error for me. -- Alan Modra Australia Development Lab, IBM

PR84300, ICE in dwarf2cfi on ppc64le

2018-02-08 Thread Alan Modra
o compile } */ +/* { dg-require-effective-target split_stack } */ +/* { dg-options "-g -O2 -fsplit-stack -fno-omit-frame-pointer" } */ + +void trap () { __builtin_trap (); } -- Alan Modra Australia Development Lab, IBM

Re: [SFN+LVU+IEPM v4 9/9] [IEPM] Introduce inline entry point markers

2018-02-08 Thread Alan Modra
uot; when compiling libdecnumber. -- Alan Modra Australia Development Lab, IBM

PR84033, powerpc64le -moptimize-swaps bad code with vec_vbpermq

2018-01-25 Thread Alan Modra
3) +__builtin_abort (); + return 0; +} -- Alan Modra Australia Development Lab, IBM

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-11 Thread Alan Modra
On Wed, Jan 10, 2018 at 05:13:36PM -0700, Jeff Law wrote: > On 01/08/2018 07:23 AM, Alan Modra wrote: > > On Sun, Jan 07, 2018 at 04:36:20PM -0700, Jeff Law wrote: > >> On 01/07/2018 03:58 PM, H.J. Lu wrote: > >>> This set of patches for GCC 8 mitigates

Re: [PATCH 0/5] x86: CVE-2017-5715, aka Spectre

2018-01-08 Thread Alan Modra
code when executed at an offset from the start of the "real" instructions. Which is why x86 is more at risk from this attack than other processors, and why x86 needs something like the posted variant 2 mitigation, slowing down all indirect branches. -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Fix PR83452

2017-12-19 Thread Alan Modra
__gnu_lto_slim".. So another possibility would be for gcc to switch to using "__gnu__LTO_v1", with the replacement being "__LTO_v1". Or emit an entirely new symbol just to use as a replacement.) -- Alan Modra Australia Development Lab, IBM

Require ngettext in test of system gettext implementation

2017-11-06 Thread Alan Modra
./config) AM_GNU_GETTEXT_VERSION(0.12.1) -AM_GNU_GETTEXT +AM_GNU_GETTEXT([], [need-ngettext]) # This replaces the extensive use of DEFS in the original Makefile.in. AC_DEFINE(IN_LIBINTL, 1, [Define because this is libintl.]) -- Alan Modra Australia Development Lab, IBM

Re: PR82687, g++.dg/asan/default-options-1.C fails with PR82575 fix

2017-10-24 Thread Alan Modra
On Tue, Oct 24, 2017 at 11:48:27AM +0200, Richard Biener wrote: > On Tue, 24 Oct 2017, Alan Modra wrote: > > The problem with making discarded symbols hidden is that the > > non-default visibility is sticky. When symbols other than the > > __gnu_lto ones are discarded that

PR82687, g++.dg/asan/default-options-1.C fails with PR82575 fix

2017-10-24 Thread Alan Modra
Was Re: PR82575, lto debugobj references __gnu_lto_slim, ld test liblto-17 fails On Fri, Oct 20, 2017 at 12:00:04AM +1030, Alan Modra wrote: > PR lto/82575 > * simple-object-elf.c (simple_object_elf_copy_lto_debug_sections): > Make discarded non-local symbols weak a

PR82575, lto debugobj references __gnu_lto_slim, ld test liblto-17 fails

2017-10-19 Thread Alan Modra
), - STT_NOTYPE); - *st_other = STV_DEFAULT; } } XDELETEVEC (strings); -- Alan Modra Australia Development Lab, IBM

Re: strlen optimizations based on whether stpcpy is declared?

2017-10-02 Thread Alan Modra
cpy with completely unrelated prototype > used for something else. In such case we don't want to introduce stpcpy > into a TU that didn't have such a call. So, we use the existence of > a matching prototype as a sign that stpcpy can be synthetized. Why is the test for stpcpy being declared done for the strcpy cases rather than the stpcpy cases? -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Asm memory constraints

2017-09-28 Thread Alan Modra
On Mon, Aug 21, 2017 at 10:29:30AM +0930, Alan Modra wrote: > Fixed in this revised patch. The only controversial aspect now should > be whether those array casts ought to be officially blessed. I've > checked that "=m" (*(T (*)[]) ptr), "=m" (*(T (*)[n]) ptr), and &

[RS6000] PR81996, __builtin_return_address(0) fails

2017-09-17 Thread Alan Modra
e, lr_save_off); + return gen_rtx_MEM (Pmode, lr_save_addr); } cfun->machine->ra_need_lr = 1; -- Alan Modra Australia Development Lab, IBM

Re: [PATCH, rs6000] Don't mark the TOC reg as set up in prologue

2017-09-14 Thread Alan Modra
PR51872 no longer there? Or is it? This code in rs6000_set_up_by_prologue: if (!TARGET_SINGLE_PIC_BASE && TARGET_TOC && TARGET_MINIMAL_TOC && !constant_pool_empty_p ()) add_to_hard_reg_set (>set, Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM); adds r30, the -mm

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-08-28 Thread Alan Modra
. The patch went in trunk as 5a402d649 (r250974) and a9b2df6cc (r251065). PR81170 and PR81295 are still open due to needing a fix for powerpc --enable-default-pie on the branches. Last I checked, both patches apply without any difficulty. https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00831.ht

Re: Clobbers and Scratch Registers

2017-08-21 Thread Alan Modra
On Tue, Aug 22, 2017 at 01:41:21PM +0930, Alan Modra wrote: > + "#n=%1 ap=%8=%12 lda=%13 x=%7=%10 y=%0=%2 alpha=%9 o16=%11\n" > + "#a0=%3 a1=%4 a2=%5 a3=%6" > + : > + "+m" (*(double (*)[n]) y), > + "+r" (n),

Re: Clobbers and Scratch Registers

2017-08-21 Thread Alan Modra
: + "cr0", + "vs32","vs33","vs34","vs35","vs36","vs37", + "vs40","vs41","vs42","vs43","vs44","vs45","vs46","vs47" + ); +@} +@end smallexample + @anchor{GotoLabels} @subsubsection Goto Labels @cindex @code{asm} goto labels -- Alan Modra Australia Development Lab, IBM

Clobbers and Scratch Registers

2017-08-20 Thread Alan Modra
// 13 + : + "cr0", + "vs32","vs33","vs34","vs35","vs36","vs37", + "vs40","vs41","vs42","vs43","vs44","vs45","vs46","vs47" + ); +@} +@end smallexample + @anchor{GotoLabels} @subsubsection Goto Labels @cindex @code{asm} goto labels -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Asm memory constraints

2017-08-20 Thread Alan Modra
On Sun, Aug 20, 2017 at 08:00:53AM -0500, Segher Boessenkool wrote: > Hi Alan, > > On Sat, Aug 19, 2017 at 12:19:35AM +0930, Alan Modra wrote: > > +Flushing registers to memory has performance implications and may be > > +an issue for time-sensitive code. You can provi

[PATCH] Asm memory constraints

2017-08-18 Thread Alan Modra
uot;a" (0)); + return -2 - count; +} + +static int +f2 (const char *p) +{ + int count; + + __asm__ ("repne scasb" + : "=c" (count), "+D" (p) + : "m" (*(const char (*)[48]) p), "0" (-1), "a" (0)); + return -2 - count; +} + +static int +f3 (int n, const char *p) +{ + int count; + + __asm__ ("repne scasb" + : "=c" (count), "+D" (p) + : "m" (*(const char (*)[n]) p), "0" (-1), "a" (0)); + return -2 - count; +} + +int +main () +{ + int a; + char buff[48] = "hello world"; + buff[4] = 0; + a = f1 (buff); + if (a != 4) +__builtin_abort (); + buff[4] = 'o'; + a = f2 (buff); + if (a != 11) +__builtin_abort (); + buff[4] = 0; + a = f3 (48, buff); + if (a != 4) +__builtin_abort (); + return 0; +} -- Alan Modra Australia Development Lab, IBM

Re: Optimization breaks inline asm code w/ptrs

2017-08-17 Thread Alan Modra
On Thu, Aug 17, 2017 at 04:27:12PM +0200, Michael Matz wrote: > Hi, > > On Mon, 14 Aug 2017, Alan Modra wrote: > > > I've opened https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81845 to track > > the lack of documentation. > > You mean like in this paragraph discu

Re: [RS6000] PR 80938, Don't emit eh_frame for regs that don't need saving

2017-08-16 Thread Alan Modra
On Wed, Aug 16, 2017 at 06:23:13PM -0500, Segher Boessenkool wrote: > Hi! > > On Wed, Aug 16, 2017 at 08:05:04AM +0930, Alan Modra wrote: > > Repost with requested changes. I've extracted the logic that omits > > frame saves from rs6000_frame_related to a new function, be

Re: Optimization breaks inline asm code w/ptrs

2017-08-16 Thread Alan Modra
On Tue, Aug 15, 2017 at 03:09:15PM +0800, Liu Hao wrote: > On 2017/8/14 20:41, Alan Modra wrote: > >On Sun, Aug 13, 2017 at 10:25:14PM +0930, Alan Modra wrote: > >>On Sun, Aug 13, 2017 at 03:35:15AM -0700, David Wohlferd wrote: > >>>Using "m"(*pStr) as a

Re: [PATCH] PR81747, ICE in operator[]

2017-08-15 Thread Alan Modra
Ping? On Wed, Aug 09, 2017 at 08:58:31PM +0930, Alan Modra wrote: > PR rtl-optimization/81747 > * cse.c (cse_extended_basic_block): Don't attempt to record > equivalences for degenerate conditional jumps that branch > to their fall-through. > > diff -

[RS6000] Delete code made dead by r250482

2017-08-15 Thread Alan Modra
; if (TARGET_STFIWX) rs6000_constraints[RS6000_CONSTRAINT_wx] = FLOAT_REGS; /* DImode */ -- Alan Modra Australia Development Lab, IBM

Re: [RS6000] PR 80938, Don't emit eh_frame for regs that don't need saving

2017-08-15 Thread Alan Modra
oad (reg, sp_reg_rtx, info->fp_save_offset + 8 * i); - if (flag_shrink_wrap) + if (flag_shrink_wrap + && save_reg_p (info->first_fp_reg_save + i)) cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores); } -- Alan Modra Australia Development Lab, IBM

Re: Optimization breaks inline asm code w/ptrs

2017-08-14 Thread Alan Modra
On Sun, Aug 13, 2017 at 10:25:14PM +0930, Alan Modra wrote: > On Sun, Aug 13, 2017 at 03:35:15AM -0700, David Wohlferd wrote: > > Using "m"(*pStr) as an (unused) input parameter has no effect. > > Use "m" (*(const void *)pStr) and ignore the warning, or use &g

Re: Optimization breaks inline asm code w/ptrs

2017-08-13 Thread Alan Modra
se that is exactly what *pStr is, but in this context it would be nicer if it meant the entire array. -- Alan Modra Australia Development Lab, IBM

Re: PING^2: [PATCH] PR driver/81523: Make -static override -pie

2017-08-12 Thread Alan Modra
t because I'd like to fix --enable-default-pie for powerpc on the branches. If this patch is accepted for the branches then both it and my r251065 patch are simple cherry-picks. -- Alan Modra Australia Development Lab, IBM

[RS6000] PR 80938, Don't emit eh_frame for regs that don't need saving

2017-08-10 Thread Alan Modra
; @@ -28643,7 +28660,8 @@ rs6000_emit_epilogue (int sibcall) RTVEC_ELT (p, elt++) = gen_frame_load (reg, sp_reg_rtx, info->fp_save_offset + 8 * i); - if (flag_shrink_wrap) + if (flag_shrink_wrap + && save_reg_p (info->first_fp_reg_save + i)) cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores); } -- Alan Modra Australia Development Lab, IBM

[RS6000] Merge rs6000_reg_live_or_pic_offset_p into save_reg_p

2017-08-10 Thread Alan Modra
(cfun->machine->gpr_is_wrapped_separately[i]) - continue; - rtx reg = gen_rtx_REG (reg_mode, i); cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores); } -- Alan Modra Australia Development Lab, IBM

[RS6000] Don't restore fixed regs

2017-08-10 Thread Alan Modra
IPLE)) == SAVE_INLINE_GPRS && (strategy & (REST_INLINE_GPRS | REST_MULTIPLE)) != REST_INLINE_GPRS) { - int i; - for (i = info->first_gp_reg_save; i < 32; i++) - if (fixed_reg_p (i) || !save_reg_p (i)) + if (!save_reg_p (i)) { strategy |=

[RS6000] linux startfile/endfile

2017-08-10 Thread Alan Modra
s; \ + fvtable-verify=std:vtv_end.o%s} \ + %{static:crtend.o%s; \ + shared|" PIE_SPEC ":crtendS.o%s; \ + :crtend.o%s} \ + %{mnewlib:ecrtn.o%s;:crtn.o%s} \ + " CRTOFFLOADEND #define LINK_START_LINUX_SPEC "" -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] rs6000: Use SAVE_MULTIPLE only if we restore what it saves (PR80938)

2017-08-09 Thread Alan Modra
On Wed, Aug 09, 2017 at 09:28:22PM -0500, Segher Boessenkool wrote: > On Thu, Aug 10, 2017 at 10:33:05AM +0930, Alan Modra wrote: > > On Wed, Aug 09, 2017 at 09:06:18PM +, Segher Boessenkool wrote: > > > We can have SAVE_MULTIPLE while we do not have REST_MULTIPLE. If the &g

Re: [PATCH] rs6000: Use SAVE_MULTIPLE only if we restore what it saves (PR80938)

2017-08-09 Thread Alan Modra
ions cause the same problem? I haven't looked yet, but at a guess I suspect the correct solution is to modify cfa_restores in rs6000_emit_epilogue. -- Alan Modra Australia Development Lab, IBM

[PATCH] PR81747, ICE in operator[]

2017-08-09 Thread Alan Modra
insn) && single_set (insn) && any_condjump_p (insn)) -- Alan Modra Australia Development Lab, IBM

Re: PING: [PATCH] PR driver/81523: Make -static override -pie

2017-07-31 Thread Alan Modra
; -static completely override -pie to create a static executable, regardless > >> if --enable-default-pie is used to configure GCC. > >> > >> OK for master? > >> > >> H.J. > >> -- > >> 2017-07-23 Alan Modra <amo...@gmail.com

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-18 Thread Alan Modra
v4.h linux support ought to be using the gnu-user.h defines rather than copying them, something I've told Segher I'll look at after this patch goes in. -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-18 Thread Alan Modra
port/gnu/import/git/sources/glibc/elf/get-dynamic-info.h:48: > undefined reference to `_DYNAMIC' > collect2: error: ld returned 1 exit status > [hjl@gnu-tools-1 build-x86_64-linux]$ > > Will your change fix it? You have got to be joking! How should I know whether something wil

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-17 Thread Alan Modra
On Mon, Jul 17, 2017 at 06:01:47AM -0700, H.J. Lu wrote: > On Mon, Jul 17, 2017 at 5:33 AM, Alan Modra <amo...@gmail.com> wrote: > > On Sat, Jul 15, 2017 at 06:32:40AM -0700, H.J. Lu wrote: > >> On Thu, Jun 22, 2017 at 8:28 AM, Alan Modra <amo...@gmail.com> wrote: >

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-17 Thread Alan Modra
On Sat, Jul 15, 2017 at 06:32:40AM -0700, H.J. Lu wrote: > On Thu, Jun 22, 2017 at 8:28 AM, Alan Modra <amo...@gmail.com> wrote: > > PR80044 notes that -static and -pie together behave differently when > > gcc is configured with --enable-default-pie as compared to co

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-07-15 Thread Alan Modra
On Thu, Jun 29, 2017 at 11:03:56PM +0930, Alan Modra wrote: > Ping? Linux startfile and endfile specs. > https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01678.html 3 week ping. Also fixes PR81295. -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-06-29 Thread Alan Modra
Ping? Linux startfile and endfile specs. https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01678.html -- Alan Modra Australia Development Lab, IBM

[PATCH] Fix pr80044, -static and -pie insanity, and pr81170

2017-06-22 Thread Alan Modra
tuted for crtn.o%s. */ +#if defined HAVE_LD_PIE +#define ENDFILE_LINUX_SPEC \ + "%{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ + fvtable-verify=std:vtv_end.o%s} \ + %{static:crtend.o%s; \ + shared|" PIE_SPEC ":crtendS.o%s; \ + :crtend.o%s} \ + %{mnewlib:ecrtn.o%s;:crtn.o%s} \ + " CRTOFFLOADEND +#else +#define ENDFILE_LINUX_SPEC \ + "%{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ + fvtable-verify=std:vtv_end.o%s} \ + %{static:crtend.o%s; \ + shared|pie:crtendS.o%s; \ + :crtend.o%s} \ + %{mnewlib:ecrtn.o%s;:crtn.o%s} \ + " CRTOFFLOADEND +#endif #define LINK_START_LINUX_SPEC "" -- Alan Modra Australia Development Lab, IBM

Re: [DOC PATCH] PowerPC extended asm example

2017-04-05 Thread Alan Modra
On Wed, Apr 05, 2017 at 09:37:04AM -0600, Sandra Loosemore wrote: > On 04/04/2017 06:14 AM, Alan Modra wrote: > >Revised patch. > > > >[snip] > >+@smallexample > >+static void > >+dgemv_kernel_4x4 (long n, const double *ap, long lda, > >+

Re: [DOC PATCH] PowerPC extended asm example

2017-04-04 Thread Alan Modra
asm} statement are unused, +then the @code{asm} may be deleted. Removal of dead @code{asm} +statements will not happen if they clobber @code{"memory"}. Notice +that @code{x}, @code{y}, and @code{ap} all appear twice in the +@code{asm} parameters, once to specify memory accessed, and once to +specify a base register used by the @code{asm}. You won't normally be +wasting a register by doing this as GCC can use the same register for +both purposes. However, it would be foolish to use both @code{%0} and +@code{%2} for @code{y} in this @code{asm} assembly and expect them to +be the same. + @anchor{GotoLabels} @subsubsection Goto Labels @cindex @code{asm} goto labels -- Alan Modra Australia Development Lab, IBM

[DOC PATCH] PowerPC extended asm example

2017-03-31 Thread Alan Modra
/ChangeLog @@ -1,3 +1,7 @@ +2017-03-31 Alan Modra <amo...@gmail.com> + + * doc/extend.texi (Extended Asm): Add OpenBLAS example. + 2017-03-31 Matthew Fortune <matthew.fort...@imgtec.com> * config/mips/mips-msa.md (msa_vec_extract_): Update diff --git a/gcc/doc/exten

Re: [PATCH] PR79584, lra ICE in base_to_reg

2017-02-23 Thread Alan Modra
I'm going to wait for Vlad's opinion. I've written a couple of replies and erased them, since I figure whatever I have to say doesn't carry much weight. -- Alan Modra Australia Development Lab, IBM

Re: PR79286, ira combine_and_move_insns in loops

2017-02-23 Thread Alan Modra
der if we should just drop the may_trap_p test and always do the > domination check. Yeah, seems reasonable to me. -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] PR79584, lra ICE in base_to_reg

2017-02-22 Thread Alan Modra
On Thu, Feb 23, 2017 at 11:41:09AM +1030, Alan Modra wrote: > lo_sum is indeed not valid for mem:SD. simplify_operand_subreg is > where the subreg disappears. Richard, doesn't the following say that lra is expecting to reload exactly the lo_sum address you seem to think it should not

Re: [PATCH] PR79584, lra ICE in base_to_reg

2017-02-22 Thread Alan Modra
On Wed, Feb 22, 2017 at 11:01:15PM +, Richard Sandiford wrote: > Alan Modra <amo...@gmail.com> writes: > > This patch allows lra to reload a lo_sum address. Given a mem with a > > lo_sum address as used by ppc32, decompose_mem_address returns an > > address

[PATCH] PR79584, lra ICE in base_to_reg

2017-02-22 Thread Alan Modra
ode (0, ad->mode) + ? const0_rtx : *ad->disp_term); if (!valid_address_p (ad->mode, new_inner, ad->as)) return NULL_RTX; - insn = emit_insn (gen_rtx_SET (new_reg, *ad->base_term)); + insn = emit_insn (gen_rtx_SET (new_reg, *ad-

Re: PR79286, ira combine_and_move_insns in loops

2017-02-21 Thread Alan Modra
and -O1 and above. Have you investigated just why the test fails? I don't know how to go about building a cross-toolchain for darwin, due to lack of darwin support in gas and ld. -- Alan Modra Australia Development Lab, IBM

Re: PowerPC -many

2017-02-14 Thread Alan Modra
On Tue, Feb 14, 2017 at 06:38:40PM -0600, Segher Boessenkool wrote: > On Wed, Feb 15, 2017 at 10:36:02AM +1030, Alan Modra wrote: > > Since we've been talking about obsoleting cpu support, how about > > getting rid of -many in ASM_CPU_SPEC for gcc-8? > > Sure, but that

PowerPC -many

2017-02-14 Thread Alan Modra
(with presumably run-time selection of which block of code gets executed depending on cpu). It used to be just a linux hack, but I see David uses it in aix61.h and aix71.h too? -- Alan Modra Australia Development Lab, IBM

Re: PR79286, ira combine_and_move_insns in loops

2017-02-10 Thread Alan Modra
+{ + int e; + for (int b = 0; b < 4; b++) +{ + __builtin_printf ("%d\n", b, e); + while (a && c++) + e = d[30][0]; +} + + return 0; +} -- Alan Modra Australia Development Lab, IBM

Re: PR79286, ira combine_and_move_insns in loops

2017-02-02 Thread Alan Modra
++ b/gcc/testsuite/gcc.c-torture/execute/pr79286.c @@ -0,0 +1,15 @@ +int a = 0, c = 0; +static int d[][8] = {}; + +int main () +{ + int e; + for (int b = 0; b < 4; b++) +{ + __builtin_printf ("%d\n", b, e); + while (a && c++) + e = d[300000][0]; +

PR79286, ira combine_and_move_insns in loops

2017-02-01 Thread Alan Modra
c++) + e = d[30][0]; + } + + return 0; +} -- Alan Modra Australia Development Lab, IBM

[RS6000] Don't expand strcmp and strncmp inline when -Os

2017-01-19 Thread Alan Modra
_BIG_ENDIAN || TARGET_LDBRX)" { - if (expand_strn_compare (operands, 1)) + if (!optimize_insn_for_size_p () + && expand_strn_compare (operands, 1)) DONE; else FAIL; -- Alan Modra Australia Development Lab, IBM

[RS6000] PR79144, cmpstrnsi optimization breaks glibc

2017-01-19 Thread Alan Modra
force_reg (Pmode, XEXP (src1, 0)), Pmode, force_reg (Pmode, XEXP (src2, 0)), Pmode, -- Alan Modra Australia Development Lab, IBM

Re: [ping] 3 aarch64/arm/rs6000 patches

2017-01-17 Thread Alan Modra
and why the memory would not be in the TOC Um, why are you using use_toc_relative_ref then, if not to access MEMs outside the TOC? -- Alan Modra Australia Development Lab, IBM

Re: [ping] 3 aarch64/arm/rs6000 patches

2017-01-17 Thread Alan Modra
first posted the patch, Segher asked me whether I had any concerns and I replied with the first paragraph or something like it. So I'm probably partly to blame for the delay in review. The second paragraph is me rethinking that concern. -- Alan Modra Australia Development Lab, IBM

Re: PR79066, non-PIC code generated for powerpc glibc with -fpic

2017-01-16 Thread Alan Modra
On Mon, Jan 16, 2017 at 01:49:36PM -0600, Segher Boessenkool wrote: > On Mon, Jan 16, 2017 at 03:50:01PM +1030, Alan Modra wrote: > > > > > Okay for trunk if there is nothing unexpected. Thanks! > > > > > > > > I guess I should at least build glib

Re: Powerpc bootstrap failure due to duplicate case value

2017-01-16 Thread Alan Modra
default: > break; > } I didn't think of that. Segher and I discussed the problem on #gcc and both independently decided an if() was the obvious fix. -- Alan Modra Australia Development Lab, IBM

Powerpc bootstrap failure due to duplicate case value

2017-01-16 Thread Alan Modra
|| icode == CODE_FOR_ctrsi_internal4 + || icode == CODE_FOR_ctrdi_internal4)) +return false; + return true; } -- Alan Modra Australia Development Lab, IBM

Re: PR79066, non-PIC code generated for powerpc glibc with -fpic

2017-01-15 Thread Alan Modra
On Sat, Jan 14, 2017 at 09:19:52AM -0600, Segher Boessenkool wrote: > On Sun, Jan 15, 2017 at 12:08:39AM +1030, Alan Modra wrote: > > > Have you checked if/what this changes for some bigger code? > > > > Well, the bootstrap was all langs (minus ada due to not having ada

Re: Avoid PR72749 by not using unspecs

2017-01-14 Thread Alan Modra
t; PATTERN changes again. It is reverted afterwards. PATTERN (insn) = old_pat; REG_NOTES (insn) = old_notes; INSN_CODE (insn) = old_icode; -- Alan Modra Australia Development Lab, IBM

Re: PR79066, non-PIC code generated for powerpc glibc with -fpic

2017-01-14 Thread Alan Modra
On Sat, Jan 14, 2017 at 03:28:51AM -0600, Segher Boessenkool wrote: > On Fri, Jan 13, 2017 at 10:10:12PM +1030, Alan Modra wrote: > > Bootstrapped and regression tested powerpc64-linux biarch. elf_high > > has said "Elf specific ways of loading addres

Re: Avoid PR72749 by not using unspecs

2017-01-14 Thread Alan Modra
ay > some other way. Right. I forgot to mention, I looked at all of gcc/*.o before/after the patch and saw no occurrences of any missed combines. Just the expected changes in rs6000.o, various insn-*.o from twiddling rs6000.md, and one constant change in read-rtl-function.o. -- Alan Mod

Avoid PR72749 by not using unspecs

2017-01-13 Thread Alan Modra
int 0)] UNSPEC_DOLOOP) (clobber (match_scratch:CC 3 "")) (clobber (match_scratch:P 4 ""))] "reload_completed && ! gpc_reg_operand (operands[0], SImode)" diff --git a/gcc/testsuite/gcc.c-torture/compile/pr72749.c b/gcc/testsuite/gcc.c-torture/compile/pr72749.c new file mode 100644 index 000..2ef4d9a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr72749.c @@ -0,0 +1,21 @@ +/* { dg-options "-O2 -fsched2-use-superblocks" } */ + +int as; + +void +ji (int *x4) +{ + if (0) +{ + unsigned int pv; + + while (as < 0) +{ + for (*x4 = 0; *x4 < 1; ++(*x4)) +yj: +x4 = (int *) + ++as; +} +} + goto yj; +} -- Alan Modra Australia Development Lab, IBM

PR79066, non-PIC code generated for powerpc glibc with -fpic

2017-01-13 Thread Alan Modra
gcc/testsuite/gcc.target/powerpc/pr79066.c new file mode 100644 index 000..86b2014 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr79066.c @@ -0,0 +1,14 @@ +/* { dg-do compile { target { fpic && ilp32 } } } */ +/* { dg-options "-O2 -fpic" } */ +/* { dg-final { scan-assembler-not "lis.*@ha" } } */ + +union U { double x; int i[2]; }; + +double +foo (double x) +{ + union U v; + v.i[0] = 0x7ff0; + v.i[1] = 0; + return x / v.x; +} -- Alan Modra Australia Development Lab, IBM

Update configure deps, remove stray \xA0 in picflag.m4, regen

2017-01-04 Thread Alan Modra
. * testsuite/Makefile.in: Regenerate. diff --git a/ChangeLog b/ChangeLog index a6241ae..db4125a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-01-04 Alan Modra <amo...@gmail.com> + + * configure: Regenerate. + 2016-12-29 Ben Elliston <b..

Re: config/ sync with binutils vs. removing gcc targets.

2016-12-07 Thread Alan Modra
On Wed, Dec 07, 2016 at 08:46:32PM +0900, Oleg Endo wrote: > Hi, > > Yeah, my SH5/SH64 removal procedures might have been a little too > radical, sorry about that. However ... > > On Wed, 2016-12-07 at 09:10 +1030, Alan Modra wrote: > > I understand that confi

config/ sync with binutils vs. removing gcc targets.

2016-12-06 Thread Alan Modra
results in an error. +dnl Avoid calling the bulk of AC_PROG_LEX when $LEX is "missing". +AC_DEFUN_ONCE([AC_PROG_LEX], +[AC_CHECK_PROGS(LEX, flex lex, :) +case "$LEX" in + :|*"missing "*) ;; + *) _AC_PROG_LEX_YYTEXT_DECL ;; +esac]) + ]) -- Alan Modra Australia Development Lab, IBM

[RS6000] fix rtl checking internal compiler error

2016-11-30 Thread Alan Modra
- || XEXP (XEXP (SET_SRC (use_body), 0), 1) != const0_rtx) + || XVECEXP (SET_SRC (use_body), 0, 1) != const0_rtx) return 0; } } -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Fix rtl sharing bug in rs6000_frame_related (PR target/78614)

2016-11-30 Thread Alan Modra
On Thu, Dec 01, 2016 at 12:36:49PM +1030, Alan Modra wrote: > On Wed, Nov 30, 2016 at 11:27:40PM +0100, Jakub Jelinek wrote: > > Markus said he has bootstrapped this patch with rtl checking on powerpc64. > > I repeated the exercise and found a stage1 bootstrap failure due to > i

Re: [PATCH] Fix rtl sharing bug in rs6000_frame_related (PR target/78614)

2016-11-30 Thread Alan Modra
LEL copy. Don't guard add_reg_note call. Call > copy_rtx_if_shared on pat before storing it into > REG_FRAME_RELATED_EXPR. -- Alan Modra Australia Development Lab, IBM

Re: [PATCH] Fix rtl sharing bug in rs6000_frame_related (PR target/78614)

2016-11-30 Thread Alan Modra
the patch that removed the "if (!repl && !reg2)" block. -- Alan Modra Australia Development Lab, IBM

<    1   2   3   4   5   6   7   8   9   10   >