Bug 15112 - [3.4 Regression] optimizer generates code to write to unchanging memory
Summary: [3.4 Regression] optimizer generates code to write to unchanging memory
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Eric Botcazou
Keywords: wrong-code
Depends on:
Reported: 2004-04-24 10:32 UTC by p.van-hoof
Modified: 2004-05-02 12:42 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2004-04-24 13:45:48

code that triggers the bug (333 bytes, application/octet-stream)
2004-04-24 10:33 UTC, p.van-hoof

Note You need to log in before you can comment on or make changes to this bug.
Description p.van-hoof 2004-04-24 10:32:16 UTC
This is another incarnation of the problem where the optimizer generates code
that uses unchanging memory as a spill spot. The problem can be reproduced as

dogbert> gcc -c -O3 -funroll-loops a.c i.c
dogbert> gcc a.o i.o
dogbert> a.out
Segmentation fault

In this case the const int q is being written to. This problem occurs only in
gcc 3.4.0, not in gcc 3.3.3 or the mainline.
Comment 1 p.van-hoof 2004-04-24 10:33:57 UTC
Created attachment 6155 [details]
code that triggers the bug
Comment 2 Andrew Pinski 2004-04-24 13:45:48 UTC
Comment 3 Eric Botcazou 2004-04-28 14:27:23 UTC
Comment 4 CVS Commits 2004-05-02 12:37:28 UTC
Subject: Bug 15112

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	ebotcazou@gcc.gnu.org	2004-05-02 12:37:25

Modified files:
	gcc            : ChangeLog reload1.c 

Log message:
	PR optimization/15112
	* reload1.c (reload): Don't record unchanging memory locations.


Comment 5 Eric Botcazou 2004-05-02 12:42:18 UTC
Fixed on 3.4 branch, see http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00019.html .

I'm closing this PR and will open a new one for mainline because we could devise
more sophisticated ways to address the problem.