Bug 45052 - [4.5 Regression] volatile ignored
Summary: [4.5 Regression] volatile ignored
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.2
Assignee: Richard Biener
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-07-24 10:51 UTC by Andreas Kaiser
Modified: 2010-07-31 12:12 UTC (History)
2 users (show)

See Also:
Host: yagarto 01.05.2010
Target: arm-none-eabi
Build:
Known to work: 4.3.2 4.4.1 4.4.2 4.5.2 4.6.0
Known to fail: 4.5.0 4.5.1
Last reconfirmed: 2010-07-24 14:37:40


Attachments
Source code (236 bytes, text/plain)
2010-07-24 10:52 UTC, Andreas Kaiser
Details
Bad result (407 bytes, text/plain)
2010-07-24 10:53 UTC, Andreas Kaiser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kaiser 2010-07-24 10:51:05 UTC
"volatile" seems to have no effect. ReadByte should be called 4 times with results merged in a word, instead it is called once and replicated 4 times.

arm-none-eabi-gcc -S -Os -mcpu=arm926ej-s src.c

-O0, -O2, -O3 are fine, -O1 and -Os are bad.
Comment 1 Andreas Kaiser 2010-07-24 10:52:35 UTC
Created attachment 21297 [details]
Source code
Comment 2 Andreas Kaiser 2010-07-24 10:53:57 UTC
Created attachment 21298 [details]
Bad result
Comment 3 Andreas Kaiser 2010-07-24 11:44:17 UTC
Also fine: -Os -fno-ipa-pure-const
Comment 4 Richard Biener 2010-07-24 14:37:40 UTC
Confirmed.  I have a patch.
Comment 5 Richard Biener 2010-07-26 09:27:08 UTC
Subject: Bug 45052

Author: rguenth
Date: Mon Jul 26 09:26:43 2010
New Revision: 162528

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162528
Log:
2010-07-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45052
	* ipa-pure-const.c (check_stmt): Check volatileness.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-pure-const.c

Comment 6 Richard Biener 2010-07-31 09:30:00 UTC
GCC 4.5.1 is being released, adjusting target milestone.
Comment 7 Richard Biener 2010-07-31 12:12:54 UTC
Fixed.
Comment 8 Richard Biener 2010-07-31 12:13:06 UTC
Subject: Bug 45052

Author: rguenth
Date: Sat Jul 31 12:12:43 2010
New Revision: 162781

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162781
Log:
2010-07-31  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45052
	* ipa-pure-const.c (check_stmt): Check volatileness.

Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/ipa-pure-const.c