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
Status: RESOLVED FIXED
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
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
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


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

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

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
Confirmed.
Comment 3 Eric Botcazou 2004-04-28 14:27:23 UTC
Investigating.
Comment 4 GCC 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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.428&r2=2.2326.2.429
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload1.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.419.4.4&r2=1.419.4.5

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.