* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
@ 2008-03-05 15:29 ` rguenth at gcc dot gnu dot org
2008-03-05 15:29 ` rguenth at gcc dot gnu dot org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-05 15:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-03-05 15:28 -------
Of course the testcase invokes undefined behavior at runtime.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code, wrong-
| |code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
2008-03-05 15:29 ` [Bug tree-optimization/35468] " rguenth at gcc dot gnu dot org
@ 2008-03-05 15:29 ` rguenth at gcc dot gnu dot org
2008-03-06 10:11 ` rguenth at gcc dot gnu dot org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-05 15:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-03-05 15:27 -------
This is done by several passes through the magics of fold_stmt_r:
case ARRAY_REF:
/* If we are not processing expressions found within an
ADDR_EXPR, then we can fold constant array references. */
if (!*inside_addr_expr_p)
t = fold_read_from_constant_string (expr);
else
t = NULL;
break;
we should remember if we are visiting the LHS of an expression here.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-03-05 15:27:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
2008-03-05 15:29 ` [Bug tree-optimization/35468] " rguenth at gcc dot gnu dot org
2008-03-05 15:29 ` rguenth at gcc dot gnu dot org
@ 2008-03-06 10:11 ` rguenth at gcc dot gnu dot org
2008-03-06 10:34 ` rguenth at gcc dot gnu dot org
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-06 10:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-03-06 10:10 -------
Actually, CCP propagates the invariant address in
D.1547_2 = &"/dev/ptyXX"[8];
*D.1547_2 ={v} 1;
which we cannot undo easily, so we indeed should fold the stmt to a
trap representation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-03-06 10:11 ` rguenth at gcc dot gnu dot org
@ 2008-03-06 10:34 ` rguenth at gcc dot gnu dot org
2008-03-06 10:36 ` rguenth at gcc dot gnu dot org
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-06 10:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2008-03-06 10:34 -------
Created an attachment (id=15268)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15268&action=view)
patch
Like with this patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-03-06 10:34 ` rguenth at gcc dot gnu dot org
@ 2008-03-06 10:36 ` rguenth at gcc dot gnu dot org
2008-08-11 1:02 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-06 10:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-03-06 10:35 -------
(later)
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2008-03-05 15:27:56 |2008-03-06 10:35:49
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-03-06 10:36 ` rguenth at gcc dot gnu dot org
@ 2008-08-11 1:02 ` pinskia at gcc dot gnu dot org
2008-08-11 1:03 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-11 1:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-08-11 01:01 -------
*** Bug 36532 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |matti dot niemenmaa+gccbugs
| |at iki dot fi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (5 preceding siblings ...)
2008-08-11 1:02 ` pinskia at gcc dot gnu dot org
@ 2008-08-11 1:03 ` pinskia at gcc dot gnu dot org
2008-08-11 1:04 ` [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-11 1:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2008-08-11 01:02 -------
This happens with the short testcase which does not need -fno-tree-dce and it
only needs -O0:
int main() {
*"c" = 'x';
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (6 preceding siblings ...)
2008-08-11 1:03 ` pinskia at gcc dot gnu dot org
@ 2008-08-11 1:04 ` pinskia at gcc dot gnu dot org
2008-08-22 14:34 ` rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-11 1:04 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Known to fail| |4.2.0 4.3.0 4.4.0
Known to work| |4.1.0 4.0.1
Summary|LHS of assignment can be |[4.2/4.3/4.4 Regression] LHS
|folded to a constant causing|of assignment can be folded
|ICE |to a constant causing ICE
Target Milestone|--- |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (7 preceding siblings ...)
2008-08-11 1:04 ` [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2008-08-22 14:34 ` rguenth at gcc dot gnu dot org
2008-12-08 15:09 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-22 14:34 UTC (permalink / raw)
To: gcc-bugs
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (8 preceding siblings ...)
2008-08-22 14:34 ` rguenth at gcc dot gnu dot org
@ 2008-12-08 15:09 ` rguenth at gcc dot gnu dot org
2008-12-09 14:12 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-08 15:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from rguenth at gcc dot gnu dot org 2008-12-08 15:06 -------
Unassigning for now.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|rguenth at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (9 preceding siblings ...)
2008-12-08 15:09 ` rguenth at gcc dot gnu dot org
@ 2008-12-09 14:12 ` jakub at gcc dot gnu dot org
2008-12-09 16:58 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-09 14:12 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2008-
| |12/msg00535.html
Status|NEW |ASSIGNED
Last reconfirmed|2008-03-06 10:35:49 |2008-12-09 14:09:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.2/4.3/4.4 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (10 preceding siblings ...)
2008-12-09 14:12 ` jakub at gcc dot gnu dot org
@ 2008-12-09 16:58 ` jakub at gcc dot gnu dot org
2008-12-09 17:12 ` [Bug tree-optimization/35468] [4.2/4.3 " jakub at gcc dot gnu dot org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-09 16:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2008-12-09 16:57 -------
Subject: Bug 35468
Author: jakub
Date: Tue Dec 9 16:55:35 2008
New Revision: 142598
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142598
Log:
PR tree-optimization/35468
* tree-ssa-ccp.c (fold_stmt_r): Don't fold reads from constant
string on LHS.
* gcc.dg/pr35468.c: New test.
* gcc.c-torture/compile/pr35468.c: New test.
Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr35468.c
trunk/gcc/testsuite/gcc.dg/pr35468.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-ccp.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.2/4.3 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (11 preceding siblings ...)
2008-12-09 16:58 ` jakub at gcc dot gnu dot org
@ 2008-12-09 17:12 ` jakub at gcc dot gnu dot org
2009-03-31 20:48 ` [Bug tree-optimization/35468] [4.3 " jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-09 17:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from jakub at gcc dot gnu dot org 2008-12-09 17:09 -------
Fixed on the trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.2.0 4.3.0 4.4.0 |4.2.0 4.3.0
Known to work|4.1.0 4.0.1 |4.1.0 4.0.1 4.4.0
Summary|[4.2/4.3/4.4 Regression] LHS|[4.2/4.3 Regression] LHS of
|of assignment can be folded |assignment can be folded to
|to a constant causing ICE |a constant causing ICE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.3 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (12 preceding siblings ...)
2008-12-09 17:12 ` [Bug tree-optimization/35468] [4.2/4.3 " jakub at gcc dot gnu dot org
@ 2009-03-31 20:48 ` jsm28 at gcc dot gnu dot org
2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
2010-05-22 18:22 ` rguenth at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 20:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from jsm28 at gcc dot gnu dot org 2009-03-31 20:48 -------
Closing 4.2 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.2/4.3 Regression] LHS of |[4.3 Regression] LHS of
|assignment can be folded to |assignment can be folded to
|a constant causing ICE |a constant causing ICE
Target Milestone|4.2.5 |4.3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.3 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (13 preceding siblings ...)
2009-03-31 20:48 ` [Bug tree-optimization/35468] [4.3 " jsm28 at gcc dot gnu dot org
@ 2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
2010-05-22 18:22 ` rguenth at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-08-04 12:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from rguenth at gcc dot gnu dot org 2009-08-04 12:28 -------
GCC 4.3.4 is being released, adjusting target milestone.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.4 |4.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug tree-optimization/35468] [4.3 Regression] LHS of assignment can be folded to a constant causing ICE
2008-03-05 8:30 [Bug tree-optimization/35468] New: LHS of assignment can be folded to a constant causing ICE maddox at gcc dot gnu dot org
` (14 preceding siblings ...)
2009-08-04 12:45 ` rguenth at gcc dot gnu dot org
@ 2010-05-22 18:22 ` rguenth at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-05-22 18:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from rguenth at gcc dot gnu dot org 2010-05-22 18:12 -------
GCC 4.3.5 is being released, adjusting target milestone.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.3.5 |4.3.6
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35468
^ permalink raw reply [flat|nested] 17+ messages in thread