[PATCH] rtl-optimization/71709, strcpy arg optimised out

2016-07-01 Thread Alan Modra
= PREV_INSN (prev); -- 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

[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: [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 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

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: 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: 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

[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

[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

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: 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

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

[RS6000] rs6000_preferred_reload_class

2016-08-03 Thread Alan Modra
On Wed, Aug 03, 2016 at 03:30:53PM -0400, Michael Meissner wrote: > On Mon, Aug 01, 2016 at 09:00:43AM +0930, Alan Modra wrote: > > Hi Mike, > > I've been looking at a lot of reload/lra code lately in trying to fix > > pr71680, and noticed a change to rs6000_p

Re: [PATCH 1/2][RS6000] .gnu.attribute Tag_GNU_Power_ABI_FP

2016-09-29 Thread Alan Modra
s. svn r240639. -- Alan Modra Australia Development Lab, IBM

[RS6000] ABI_V4 ifunc

2016-08-23 Thread Alan Modra
I (match_dup 1)) @@ -10389,9 +10395,11 @@ (use (match_operand:SI 3 "immediate_operand" "O,n")) (use (match_operand:SI 4 "register_operand" "r,r")) (clobber (reg:SI LR_REGNO))] - "(DEFAULT_ABI == ABI_V4 -&& TARGET_SECURE_PLT && flag_pic && !SYMBOL_REF_LOCAL_P (operands[1]) -&& (INTVAL (operands[3]) & CALL_LONG) == 0)" + "DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic + && (!SYMBOL_REF_LOCAL_P (operands[1]) + || SYMBOL_REF_EXTERNAL_P (operands[1]) + || SYMBOL_REF_WEAK (operands[1])) + && (INTVAL (operands[3]) & CALL_LONG) == 0" { if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS) output_asm_insn ("crxor 6,6,6", operands); -- Alan Modra Australia Development Lab, IBM

Re: [PATCH 1/2][RS6000] .gnu.attribute Tag_GNU_Power_ABI_FP

2016-09-28 Thread Alan Modra
Committed as svn r240601 and patch 2/2 as r240602. -- Alan Modra Australia Development Lab, IBM

[PATCH 2/2] Disable .gnu_attribute tags in compatibility-ldbl.o

2016-09-27 Thread Alan Modra
OMPILE) $(LONG_DOUBLE_COMPAT_FLAGS) -c $< compatibility-ldbl.o: compatibility-ldbl.cc - $(CXXCOMPILE) -mlong-double-64 -c $< + $(CXXCOMPILE) $(LONG_DOUBLE_COMPAT_FLAGS) -c $< endif # Use special rules for C++11 files/objects. -- Alan Modra Australia Development Lab, IBM

[PATCH 1/2][RS6000] .gnu.attribute Tag_GNU_Power_ABI_FP

2016-09-27 Thread Alan Modra
ame -r -o conftest.o conftest1.o conftest2.o > /dev/null 2> conftest.err \ +&& test ! -s conftest.err; then +gcc_cv_ld_ppc_attr=yes + fi + rm -f conftest.err conftest.o conftest1.o conftest2.o conftest1.s conftest2.s +fi +]) +if test x$gcc_cv_ld_ppc_attr = xyes; then + AC_DEFINE(HAVE_LD_PPC_GNU_ATTR, 1, +[Define if your PowerPC linker has .gnu_attribute long double support.]) +fi +;; +esac + case "$target:$tm_file" in powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) case "$target" in -- Alan Modra Australia Development Lab, IBM

Re: [PATCH 2/2] Disable .gnu_attribute tags in compatibility-ldbl.o

2016-09-27 Thread Alan Modra
On Wed, Sep 28, 2016 at 01:26:12AM +, Joseph Myers wrote: > On Wed, 28 Sep 2016, Alan Modra wrote: > > > compatibility-ldbl.o is compiled with -mlong-double-64. When > > long double .gnu_attribute tags are checked by the linker, it > > complains about the mi

Re: [PATCH 1/2][RS6000] .gnu.attribute Tag_GNU_Power_ABI_FP

2016-09-27 Thread Alan Modra
On Wed, Sep 28, 2016 at 01:20:22AM +, Joseph Myers wrote: > On Wed, 28 Sep 2016, Alan Modra wrote: > > > I've also added a new option, default on, that disables output of > > .gnu_attribute tags. That's needed because this patch alone > > introduces libstdc++ test

Re: [PATCH] rs6000: Disparage CTR and LR in movcc_internal1

2016-09-26 Thread Alan Modra
"=y,x,?y,y,r,r,r,r,r,*c*l,r,m") > + (match_operand:CC 1 "general_operand" > + " y,r, r,O,x,y,r,I,h, r,m,r"))] What about that "h" lurking there? -- Alan Modra Australia Development Lab, IBM

[PATCH, IRA] PR78325, R_MIPS_JALR failures

2016-11-15 Thread Alan Modra
(use_insn); if (set && REG_P (SET_DEST (set))) -- Alan Modra Australia Development Lab, IBM

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

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
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: 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

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

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

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

[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
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
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

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: 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

[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: [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

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: [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: [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: [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: 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

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

[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

[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] 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] 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

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-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-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-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-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] 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] 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

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

[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

[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] 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 &

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

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

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

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

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: 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

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: 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 >

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

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: [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

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

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: 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

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

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] 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-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: [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: [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

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

2018-11-08 Thread Alan Modra
On Wed, Nov 07, 2018 at 07:11:28PM -0600, Segher Boessenkool wrote: > On Wed, Nov 07, 2018 at 04:08:26PM +1030, Alan Modra wrote: > > There is really no need to define a TLSmode mode iterator that is > > identical (since !TARGET_64BIT == TARGET_32BIT) to the much used P &g

Re: [RS6000] Don't pass -many to the assembler

2018-11-12 Thread Alan Modra
the right way to go, and especially so for people working on gcc itself. For people just wanting stuff to compile, not so much. I fully expect a chorus of *MORON* or worse to come from the likes of the linux kernel rabble. -- Alan Modra Australia Development Lab, IBM

Re: [RS6000] Don't pass -many to the assembler

2018-11-12 Thread Alan Modra
On Mon, Nov 12, 2018 at 04:34:34PM -0800, Mike Stump wrote: > On Nov 12, 2018, at 3:13 PM, Alan Modra wrote: > > > > For people developing new code, it's the right way to go, and > > especially so for people working on gcc itself. For people just > > wanting stuff

<    2   3   4   5   6   7   8   9   10   >