public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code
@ 2005-01-09 1:29 belyshev at depni dot sinp dot msu dot ru
2005-01-09 1:38 ` [Bug tree-optimization/19341] " pinskia at gcc dot gnu dot org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-01-09 1:29 UTC (permalink / raw)
To: gcc-bugs
void abort (void);
void __attribute__((regparm(1))) g (int *p)
{
if (*p != 1)
abort ();
}
int main ()
{
int k;
k = 1;
asm volatile ("call g" :: "a" (&k));
return 0;
}
--
Summary: [4.0 Regression] DCE eliminating non-dead code
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P1
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: belyshev at depni dot sinp dot msu dot ru
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
@ 2005-01-09 1:38 ` pinskia at gcc dot gnu dot org
2005-01-09 1:54 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 1:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 01:37 -------
This code is invalid, for one you should not do a call in inline-asm.
Second the store to k is dead as the inline-asm is not told that k is accessed.
asm volatile ("call g" :: "a" (&k), "m" (k)); will fix the DCE issue but the code is still invalid because
control flow
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
2005-01-09 1:38 ` [Bug tree-optimization/19341] " pinskia at gcc dot gnu dot org
@ 2005-01-09 1:54 ` pinskia at gcc dot gnu dot org
2005-01-12 5:41 ` rth at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-09 1:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-09 01:54 -------
Another way to fix this is to add that this inline-asm clobers memory, aka:
asm volatile ("call g" :: "a" (&k):"memory");
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
` (2 preceding siblings ...)
2005-01-12 5:41 ` rth at gcc dot gnu dot org
@ 2005-01-12 5:41 ` rth at gcc dot gnu dot org
2005-01-12 6:08 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-12 5:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2005-01-12 05:41 -------
.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
2005-01-09 1:38 ` [Bug tree-optimization/19341] " pinskia at gcc dot gnu dot org
2005-01-09 1:54 ` pinskia at gcc dot gnu dot org
@ 2005-01-12 5:41 ` rth at gcc dot gnu dot org
2005-01-12 5:41 ` rth at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-12 5:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2005-01-12 05:41 -------
Not invalid. The asm is a pointer escape point.
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|0000-00-00 00:00:00 |2005-01-12 05:41:12
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
` (3 preceding siblings ...)
2005-01-12 5:41 ` rth at gcc dot gnu dot org
@ 2005-01-12 6:08 ` pinskia at gcc dot gnu dot org
2005-01-12 10:37 ` steven at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-12 6:08 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|2005-01-12 05:41:12 |2005-01-12 06:08:11
date| |
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
` (4 preceding siblings ...)
2005-01-12 6:08 ` pinskia at gcc dot gnu dot org
@ 2005-01-12 10:37 ` steven at gcc dot gnu dot org
2005-02-02 7:15 ` rth at gcc dot gnu dot org
2005-09-30 14:04 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-12 10:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-01-12 10:37 -------
Is an asm a pointer escape point even if it does not have a memory clobber
constraint?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
` (5 preceding siblings ...)
2005-01-12 10:37 ` steven at gcc dot gnu dot org
@ 2005-02-02 7:15 ` rth at gcc dot gnu dot org
2005-09-30 14:04 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-02-02 7:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From rth at gcc dot gnu dot org 2005-02-02 07:15 -------
Good point. You've got to indicate that you touch memory in some way in order
to force the compiler to make memory consistent before the asm.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tree-optimization/19341] [4.0 Regression] DCE eliminating non-dead code
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
` (6 preceding siblings ...)
2005-02-02 7:15 ` rth at gcc dot gnu dot org
@ 2005-09-30 14:04 ` pinskia at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-30 14:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-30 14:04 -------
*** Bug 24146 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19341
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-09-30 14:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-09 1:29 [Bug tree-optimization/19341] New: [4.0 Regression] DCE eliminating non-dead code belyshev at depni dot sinp dot msu dot ru
2005-01-09 1:38 ` [Bug tree-optimization/19341] " pinskia at gcc dot gnu dot org
2005-01-09 1:54 ` pinskia at gcc dot gnu dot org
2005-01-12 5:41 ` rth at gcc dot gnu dot org
2005-01-12 5:41 ` rth at gcc dot gnu dot org
2005-01-12 6:08 ` pinskia at gcc dot gnu dot org
2005-01-12 10:37 ` steven at gcc dot gnu dot org
2005-02-02 7:15 ` rth at gcc dot gnu dot org
2005-09-30 14:04 ` pinskia 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).