public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/35136]  New: [Ada] ICE caused by address calculation with loop variable when optimization is on
@ 2008-02-08 10:29 markus dot heichel at comsoft dot de
  2008-02-08 11:12 ` [Bug ada/35136] [4.3 Regression] " rguenth at gcc dot gnu dot org
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: markus dot heichel at comsoft dot de @ 2008-02-08 10:29 UTC (permalink / raw)
  To: gcc-bugs

The example below raises an UNRECOVERABLE_ERROR when compiled with
optimization:

gcc -c -O adr.adb

This seems to be a regression in snapshot 4.3.0-20080201. It is working in
4.3.0-20080111 and older releases like 4.2.3.

adr.adb
================================================
pragma Extend_System(AUX_DEC);
with SYSTEM;

procedure ADR is

   function Y(E : in INTEGER) return STRING is
   begin
      return "";
   end Y;

   function X(C : in SYSTEM.ADDRESS) return STRING is
      D : INTEGER;
      for D use at C;
   begin
      return Y(D);
   end X;

   A : SYSTEM.ADDRESS;
   B : STRING := "";

begin
   for I in 0..1 loop
      B := X(SYSTEM."+"(A, I));
   end loop;
end ADR;
================================================


-- 
           Summary: [Ada] ICE caused by address calculation with loop
                    variable when optimization is on
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: markus dot heichel at comsoft dot de
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug ada/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
@ 2008-02-08 11:12 ` rguenth at gcc dot gnu dot org
  2008-02-08 11:17 ` markus dot heichel at comsoft dot de
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-08 11:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-02-08 11:11 -------
What UNRECOVERABLE_ERROR?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
            Summary|[Ada] ICE caused by address |[4.3 Regression] ICE caused
                   |calculation with loop       |by address calculation with
                   |variable when optimization  |loop variable when
                   |is on                       |optimization is on
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug ada/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
  2008-02-08 11:12 ` [Bug ada/35136] [4.3 Regression] " rguenth at gcc dot gnu dot org
@ 2008-02-08 11:17 ` markus dot heichel at comsoft dot de
  2008-02-08 11:23 ` ebotcazou at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: markus dot heichel at comsoft dot de @ 2008-02-08 11:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from markus dot heichel at comsoft dot de  2008-02-08 11:16 -------
The exception is:

TYPES.UNRECOVERABLE_ERROR : comperr.adb:398


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug ada/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
  2008-02-08 11:12 ` [Bug ada/35136] [4.3 Regression] " rguenth at gcc dot gnu dot org
  2008-02-08 11:17 ` markus dot heichel at comsoft dot de
@ 2008-02-08 11:23 ` ebotcazou at gcc dot gnu dot org
  2008-02-08 11:28 ` markus dot heichel at comsoft dot de
                   ` (16 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-08 11:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ebotcazou at gcc dot gnu dot org  2008-02-08 11:23 -------
> The exception is:
> 
> TYPES.UNRECOVERABLE_ERROR : comperr.adb:398

Please post full the error message.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug ada/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (2 preceding siblings ...)
  2008-02-08 11:23 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-08 11:28 ` markus dot heichel at comsoft dot de
  2008-02-08 22:40 ` rguenth at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: markus dot heichel at comsoft dot de @ 2008-02-08 11:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from markus dot heichel at comsoft dot de  2008-02-08 11:27 -------
The complete output is:

> gcc -c -O adr.adb
adr.adb:19:04: warning: variable "A" is read but never assigned
adr.adb: In function 'ADR':
adr.adb:5: error: expected an SSA_NAME object
adr.adb:5: error: in statement
# A.36 = VDEF <A.36> { A.36 }
A.36 = D.375_38;
+===========================GNAT BUG DETECTED==============================+
| 4.3.0 20080201 (experimental) (i686-pc-linux-gnu) verify_ssa failed      |
| Error detected around adr.adb:5                                          |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases,
so please double check that the problem can still
be reproduced with the set of files listed.

adr.adb

raised TYPES.UNRECOVERABLE_ERROR : comperr.adb:398
Exit 1


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug ada/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (3 preceding siblings ...)
  2008-02-08 11:28 ` markus dot heichel at comsoft dot de
@ 2008-02-08 22:40 ` rguenth at gcc dot gnu dot org
  2008-02-08 22:51 ` [Bug middle-end/35136] " rguenth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-08 22:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-02-08 22:39:21
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (4 preceding siblings ...)
  2008-02-08 22:40 ` rguenth at gcc dot gnu dot org
@ 2008-02-08 22:51 ` rguenth at gcc dot gnu dot org
  2008-02-08 23:06 ` steven at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-08 22:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2008-02-08 22:50 -------
4.2 works for me.  This is a middle-end/tree-optimization problem.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|ada                         |middle-end
      Known to work|                            |4.2.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (5 preceding siblings ...)
  2008-02-08 22:51 ` [Bug middle-end/35136] " rguenth at gcc dot gnu dot org
@ 2008-02-08 23:06 ` steven at gcc dot gnu dot org
  2008-02-12  8:25 ` ebotcazou at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-02-08 23:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from steven at gcc dot gnu dot org  2008-02-08 23:05 -------
Is it possible to create an equivalent C test case (e.g. from the initial
GIMPLE dumps before the ICE)?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (6 preceding siblings ...)
  2008-02-08 23:06 ` steven at gcc dot gnu dot org
@ 2008-02-12  8:25 ` ebotcazou at gcc dot gnu dot org
  2008-02-12  8:46 ` ebotcazou at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-12  8:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ebotcazou at gcc dot gnu dot org  2008-02-12 08:25 -------
Investigating.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ebotcazou at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-02-08 22:39:21         |2008-02-12 08:25:04
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (7 preceding siblings ...)
  2008-02-12  8:25 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-12  8:46 ` ebotcazou at gcc dot gnu dot org
  2008-02-12  9:09 ` ebotcazou at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-12  8:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ebotcazou at gcc dot gnu dot org  2008-02-12 08:45 -------
The failure mode is as follows: IVOPTS decices to turn the iteration on the
value of A (variable in the code) to an iteration on its address.  But there
is a cast in the middle

  a.0_4 = (system__aux_dec__TsaB) a_3(D);
  D.249_5 = i_131 + a.0_4;

so create_iv invokes force_gimple_operand on ADDR_EXPR<NOP_EXPR<SSA_NAME>>,
which is passed to gnat_gimplify_expr.  The latter creates the temporary
A.36 and it is never marked for renaming.

I think that the problem is in create_iv: it should make sure that the SSA
form is preserved, for example by invoking force_gimple_operand_bsi instead
of force_gimple_operand like some functions in tree-ssa-loop-ivopts.c.

But maybe the problem is the discrepancy between force_gimple_operand and
force_gimple_operand_bsi: why does the latter preserve the SSA form and not
the former?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (8 preceding siblings ...)
  2008-02-12  8:46 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-12  9:09 ` ebotcazou at gcc dot gnu dot org
  2008-02-12 20:50 ` ebotcazou at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-12  9:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ebotcazou at gcc dot gnu dot org  2008-02-12 09:08 -------
> But maybe the problem is the discrepancy between force_gimple_operand and
> force_gimple_operand_bsi: why does the latter preserve the SSA form and not
> the former?

This would fix the problem:

Index: gimplify.c
===================================================================
--- gimplify.c  (revision 132243)
+++ gimplify.c  (working copy)
@@ -6629,6 +6629,14 @@ force_gimple_operand (tree expr, tree *s

   pop_gimplify_context (NULL);

+  if (*stmts && gimple_in_ssa_p (cfun))
+    {
+      tree_stmt_iterator tsi;
+
+      for (tsi = tsi_start (*stmts); !tsi_end_p (tsi); tsi_next (&tsi))
+       mark_symbols_for_renaming (tsi_stmt (tsi));
+    }
+
   return expr;
 }

@@ -6648,14 +6656,6 @@ force_gimple_operand_bsi (block_stmt_ite
   expr = force_gimple_operand (expr, &stmts, simple_p, var);
   if (stmts)
     {
-      if (gimple_in_ssa_p (cfun))
-       {
-         tree_stmt_iterator tsi;
-
-         for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
-           mark_symbols_for_renaming (tsi_stmt (tsi));
-       }
-
       if (before)
        bsi_insert_before (bsi, stmts, m);
       else


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (9 preceding siblings ...)
  2008-02-12  9:09 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-12 20:50 ` ebotcazou at gcc dot gnu dot org
  2008-02-12 20:53 ` ebotcazou at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-12 20:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from ebotcazou at gcc dot gnu dot org  2008-02-12 20:50 -------
Subject: Bug 35136

Author: ebotcazou
Date: Tue Feb 12 20:49:21 2008
New Revision: 132267

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132267
Log:
        PR middle-end/35136
        * gimplify.c (force_gimple_operand_bsi): Move SSA renaming code from
        here to...
        (force_gimple_operand): ...here.


Added:
    trunk/gcc/testsuite/gnat.dg/loop_address.adb
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (10 preceding siblings ...)
  2008-02-12 20:50 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-12 20:53 ` ebotcazou at gcc dot gnu dot org
  2008-02-13  6:44 ` ebotcazou at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-12 20:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ebotcazou at gcc dot gnu dot org  2008-02-12 20:53 -------
Thanks for reporting the problem.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (11 preceding siblings ...)
  2008-02-12 20:53 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-13  6:44 ` ebotcazou at gcc dot gnu dot org
  2008-02-13  8:30 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-13  6:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from ebotcazou at gcc dot gnu dot org  2008-02-13 06:43 -------
Something is wrong.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (12 preceding siblings ...)
  2008-02-13  6:44 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-13  8:30 ` jakub at gcc dot gnu dot org
  2008-02-13  8:44 ` ebotcazou at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-02-13  8:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jakub at gcc dot gnu dot org  2008-02-13 08:29 -------
I'm not sure it is a good idea to change semantics of force_gimple_operand
this late in 4.3 cycle.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (13 preceding siblings ...)
  2008-02-13  8:30 ` jakub at gcc dot gnu dot org
@ 2008-02-13  8:44 ` ebotcazou at gcc dot gnu dot org
  2008-02-13 14:34 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-13  8:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from ebotcazou at gcc dot gnu dot org  2008-02-13 08:44 -------
> I'm not sure it is a good idea to change semantics of force_gimple_operand
> this late in 4.3 cycle.

It's not really a change of semantics, it only bridges the gap between two
functions that are supposed to behave the same, but accidentally don't.
Either they both should do SSA renaming, or they both shouldn't, but there
is no justification for the current status in my opinion.

That being said, there is a more annoying problem with IVOPTS which is now
papered over twice, instead of once previously, so I don't mind backing out
the change.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (14 preceding siblings ...)
  2008-02-13  8:44 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-13 14:34 ` rguenth at gcc dot gnu dot org
  2008-02-13 21:54 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-13 14:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2008-02-13 14:33 -------
So, what exactly is wrong now?  And what is this IVOPTs problem? ;)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (15 preceding siblings ...)
  2008-02-13 14:34 ` rguenth at gcc dot gnu dot org
@ 2008-02-13 21:54 ` ebotcazou at gcc dot gnu dot org
  2008-02-13 22:26 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-13 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from ebotcazou at gcc dot gnu dot org  2008-02-13 21:54 -------
> So, what exactly is wrong now?

Oh nothing, just the generated code. :-)

  D.375_38 = (system__aux_dec__TsaB) a_3(D);
  A.36 = D.375_38;
  A.37_35 = (system__address *) &A.36;
  ivtmp.34_32 = (unsigned int) A.37_35;

[...]

  D.379_8 = (system__aux_dec__TsaB) a_3(D);
  A.38 = D.379_8;
  D.380_1 = &A.38 + 2;
  D.381_97 = (unsigned int) D.380_1;
  if (ivtmp.34_58 == D.381_97)

We compare apples (address of A.36) with orange (address of A.38).

> And what is this IVOPTs problem? ;)

It is too optimistic about addressability.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (16 preceding siblings ...)
  2008-02-13 21:54 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-13 22:26 ` ebotcazou at gcc dot gnu dot org
  2008-02-14 19:09 ` ebotcazou at gcc dot gnu dot org
  2008-02-14 19:11 ` ebotcazou at gcc dot gnu dot org
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-13 22:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from ebotcazou at gcc dot gnu dot org  2008-02-13 22:25 -------
> It is too optimistic about addressability.

It takes the address of non-addressable things:

  base &VIEW_CONVERT_EXPR<system__address>((system__aux_dec__TsaB) a_3(D))


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (17 preceding siblings ...)
  2008-02-13 22:26 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-14 19:09 ` ebotcazou at gcc dot gnu dot org
  2008-02-14 19:11 ` ebotcazou at gcc dot gnu dot org
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-14 19:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from ebotcazou at gcc dot gnu dot org  2008-02-14 19:08 -------
Subject: Bug 35136

Author: ebotcazou
Date: Thu Feb 14 19:07:38 2008
New Revision: 132320

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132320
Log:
        PR middle-end/35136
        * gimplify.c (force_gimple_operand_bsi): Revert 2008-02-12 change.
        (force_gimple_operand): Likewise.
        * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Add new cases
        for TARGET_MEM_REF and CONVERT_EXPR/NON_LVALUE_EXPR/NOP_EXPR.
        Also recurse on the operand for regular VIEW_CONVERT_EXPRs.
        (find_interesting_uses_address): Check addressability and alignment
        of the base expression only after substituting bases of IVs into it.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/tree-ssa-loop-ivopts.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Bug middle-end/35136] [4.3 Regression] ICE caused by address calculation with loop variable when optimization is on
  2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
                   ` (18 preceding siblings ...)
  2008-02-14 19:09 ` ebotcazou at gcc dot gnu dot org
@ 2008-02-14 19:11 ` ebotcazou at gcc dot gnu dot org
  19 siblings, 0 replies; 21+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2008-02-14 19:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from ebotcazou at gcc dot gnu dot org  2008-02-14 19:10 -------
Hopefully for real this time.


-- 

ebotcazou at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35136


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2008-02-14 19:11 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 10:29 [Bug ada/35136] New: [Ada] ICE caused by address calculation with loop variable when optimization is on markus dot heichel at comsoft dot de
2008-02-08 11:12 ` [Bug ada/35136] [4.3 Regression] " rguenth at gcc dot gnu dot org
2008-02-08 11:17 ` markus dot heichel at comsoft dot de
2008-02-08 11:23 ` ebotcazou at gcc dot gnu dot org
2008-02-08 11:28 ` markus dot heichel at comsoft dot de
2008-02-08 22:40 ` rguenth at gcc dot gnu dot org
2008-02-08 22:51 ` [Bug middle-end/35136] " rguenth at gcc dot gnu dot org
2008-02-08 23:06 ` steven at gcc dot gnu dot org
2008-02-12  8:25 ` ebotcazou at gcc dot gnu dot org
2008-02-12  8:46 ` ebotcazou at gcc dot gnu dot org
2008-02-12  9:09 ` ebotcazou at gcc dot gnu dot org
2008-02-12 20:50 ` ebotcazou at gcc dot gnu dot org
2008-02-12 20:53 ` ebotcazou at gcc dot gnu dot org
2008-02-13  6:44 ` ebotcazou at gcc dot gnu dot org
2008-02-13  8:30 ` jakub at gcc dot gnu dot org
2008-02-13  8:44 ` ebotcazou at gcc dot gnu dot org
2008-02-13 14:34 ` rguenth at gcc dot gnu dot org
2008-02-13 21:54 ` ebotcazou at gcc dot gnu dot org
2008-02-13 22:26 ` ebotcazou at gcc dot gnu dot org
2008-02-14 19:09 ` ebotcazou at gcc dot gnu dot org
2008-02-14 19:11 ` ebotcazou at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).