[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-05-15 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

Alan Modra  changed:

   What|Removed |Added

URL|https://gcc.gnu.org/ml/gcc- |https://gcc.gnu.org/ml/gcc-
   |patches/2017-02/msg00050.ht |patches/2017-02/msg00133.ht
   |ml  |ml

--- Comment #13 from Alan Modra  ---
I think we're done here.

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-25 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

Bernd Edlinger  changed:

   What|Removed |Added

 CC||bernd.edlinger at hotmail dot 
de

--- Comment #12 from Bernd Edlinger  ---
Hi Jeff,

it looks like it is possible that may_trap_p returns
always wrong information if -m32 -fPIC is used.

What do you think about this?

Index: gcc/rtlanal.c
===
--- gcc/rtlanal.c   (revision 245714)
+++ gcc/rtlanal.c   (working copy)
@@ -645,8 +645,23 @@
 case PLUS:
   /* An address is assumed not to trap if:
  - it is the pic register plus a constant.  */
-  if (XEXP (x, 0) == pic_offset_table_rtx && CONSTANT_P (XEXP (x, 1)))
-   return 0;
+  if (XEXP (x, 0) == pic_offset_table_rtx
+ && GET_CODE (XEXP (x, 1)) == CONST)
+   {
+ x = XEXP (XEXP (x, 1), 0);
+ if (GET_CODE (x) == UNSPEC
+ && GET_CODE (XVECEXP (x, 0, 0)) == SYMBOL_REF)
+   return rtx_addr_can_trap_p_1(XVECEXP (x, 0, 0),
+offset, size, mode, unaligned_mems);
+ if (GET_CODE (x) == PLUS
+ && GET_CODE (XEXP (x, 0)) == UNSPEC
+ && GET_CODE (XVECEXP (XEXP (x, 0), 0, 0)) == SYMBOL_REF
+ && CONST_INT_P (XEXP (x, 1)))
+   return rtx_addr_can_trap_p_1(XVECEXP (XEXP (x, 0), 0, 0),
+offset + INTVAL (XEXP (x, 1)),
+size, mode, unaligned_mems);
+ return 1;
+   }

   /* - or it is an address that can't trap plus a constant integer.  */
   if (CONST_INT_P (XEXP (x, 1))

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-24 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Jeffrey A. Law  ---
Darwin issues should be fixed now too.

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-24 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

--- Comment #10 from Jeffrey A. Law  ---
Author: law
Date: Fri Feb 24 15:36:10 2017
New Revision: 245714

URL: https://gcc.gnu.org/viewcvs?rev=245714=gcc=rev
Log:
PR rtl-optimizatoin/79286
* ira.c (update_equiv_regs): Drop may_trap_p exception to
dominance test.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira.c

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #9 from Dominique d'Humieres  ---
See https://gcc.gnu.org/ml/gcc-patches/2017-02/msg01172.html.

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-16 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #8 from Jeffrey A. Law  ---
Fixed by Alan's patch on the trunk.

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-16 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

--- Comment #7 from Jeffrey A. Law  ---
Author: law
Date: Thu Feb 16 22:56:51 2017
New Revision: 245521

URL: https://gcc.gnu.org/viewcvs?rev=245521=gcc=rev
Log:
2017-02-16  Alan Modra  

PR rtl-optimization/79286
* ira.c (def_dominates_uses): New function.
(update_equiv_regs): Don't create an equivalence for insns that
may trap where the register def does not dominate the use.

* gcc.c-torture/execute/pr79286.c: New.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr79286.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/79286] [7 Regression] ira and lra wrong code at -O2 and -Os on i686-linux

2017-02-01 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79286

Alan Modra  changed:

   What|Removed |Added

 CC||amodra at gmail dot com
Summary|[7 Regression] wrong code   |[7 Regression] ira and lra
   |at -O3 on x86_64-linux-gnu  |wrong code at -O2 and -Os
   |in 32-bit mode (but not in  |on i686-linux
   |64-bit mode)|

--- Comment #6 from Alan Modra  ---
The testcase in comment #2 fails with x86 -m32 -Os even after fixing the ira
failure, due to lra doing
"Changing pseudo 89 in operand 1 of insn 9 on equiv [const(`d'+0x13c0)]"
This puts the load of d[300...0][0] before the printf, just like the ira bug.
The -Os failure is a regression from gcc-3.4