public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28139] New: alias information for EH is wrong
@ 2006-06-22 15:52 amylaar at gcc dot gnu dot org
2006-06-22 16:01 ` [Bug c++/28139] " amylaar at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-06-22 15:52 UTC (permalink / raw)
To: gcc-bugs
The store at the beginning of a catch block can use an alias set that is
allegedly disjoint from the one used to load that value. When scheduling,
this can cause the load to be moved before the store.
--
Summary: alias information for EH is wrong
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: wrong-code, EH
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amylaar at gcc dot gnu dot org
GCC target triplet: sh-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
@ 2006-06-22 16:01 ` amylaar at gcc dot gnu dot org
2006-06-22 16:34 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-06-22 16:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from amylaar at gcc dot gnu dot org 2006-06-22 15:52 -------
Created an attachment (id=11730)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11730&action=view)
test case
This test case should go in testsuite/g++.dg/eh .
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
2006-06-22 16:01 ` [Bug c++/28139] " amylaar at gcc dot gnu dot org
@ 2006-06-22 16:34 ` pinskia at gcc dot gnu dot org
2006-06-22 16:39 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-22 16:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-06-22 16:28 -------
Hmm, I just get an error on a 64bit target so the testcase is at least invalid
for them:
t.c:19: error: cast from 'int*' to 'int' loses precision
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
2006-06-22 16:01 ` [Bug c++/28139] " amylaar at gcc dot gnu dot org
2006-06-22 16:34 ` pinskia at gcc dot gnu dot org
@ 2006-06-22 16:39 ` pinskia at gcc dot gnu dot org
2006-06-22 16:58 ` amylaar at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-22 16:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-06-22 16:34 -------
Though it is obviously wrong from the front-end:
register void * D.2002;
(int * * const &) &D.2002
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-06-22 16:34:21
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-06-22 16:39 ` pinskia at gcc dot gnu dot org
@ 2006-06-22 16:58 ` amylaar at gcc dot gnu dot org
2006-06-22 23:36 ` amylaar at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-06-22 16:58 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from amylaar at gcc dot gnu dot org 2006-06-22 16:55 -------
(In reply to comment #2)
> Hmm, I just get an error on a 64bit target so the testcase is at least invalid
> for them:
> t.c:19: error: cast from 'int*' to 'int' loses precision
>
You can write this as:
exit ((int)(long long) &i);
I have verified that this also reproduces the problem on sh-elf.
(In reply to comment #3)
> Though it is obviously wrong from the front-end:
> register void * D.2002;
> (int * * const &) &D.2002
>
As far as I can tell, this code in cp/except.c:expand_start_catch_block:
/* Otherwise the type uses a bitwise copy, and we don't have to worry
about the value of std::uncaught_exception and therefore can do the
copy with the return value of __cxa_end_catch instead. */
else
{
tree init = do_begin_catch ();
exp = create_temporary_var (ptr_type_node);
DECL_REGISTER (exp) = 1;
cp_finish_decl (exp, init, /*init_const_expr=*/false,
NULL_TREE, LOOKUP_ONLYCONVERTING);
initialize_handler_parm (decl, exp);
is wrong. exp has the wrong type, hence the store emitted by cp_finish_decl
will end up with the wrong alias set.
I'm not sure yet what the right type is, though. would that be the type of decl
for pointers, and a pointer to that type for non-pointers? Or a reference?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-06-22 16:58 ` amylaar at gcc dot gnu dot org
@ 2006-06-22 23:36 ` amylaar at gcc dot gnu dot org
2006-06-29 21:43 ` patchapp at dberlin dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-06-22 23:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from amylaar at gcc dot gnu dot org 2006-06-22 22:16 -------
Created an attachment (id=11732)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11732&action=view)
patch
I'm currently testing this patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (4 preceding siblings ...)
2006-06-22 23:36 ` amylaar at gcc dot gnu dot org
@ 2006-06-29 21:43 ` patchapp at dberlin dot org
2006-07-03 16:39 ` amylaar at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: patchapp at dberlin dot org @ 2006-06-29 21:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from patchapp at dberlin dot org 2006-06-29 21:42 -------
Subject: Bug number PR 28139
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01295.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (5 preceding siblings ...)
2006-06-29 21:43 ` patchapp at dberlin dot org
@ 2006-07-03 16:39 ` amylaar at gcc dot gnu dot org
2006-08-25 22:27 ` mrs at apple dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-07-03 16:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from amylaar at gcc dot gnu dot org 2006-07-03 16:39 -------
The keyword description says that the "alias" keyword is specific to missed
optimizations due to aliasing issues.
If that is true, than adding this keyword here was incorrect. If that isn't
true, then the keyword description should be corrected.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (6 preceding siblings ...)
2006-07-03 16:39 ` amylaar at gcc dot gnu dot org
@ 2006-08-25 22:27 ` mrs at apple dot com
2006-08-29 14:34 ` amylaar at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mrs at apple dot com @ 2006-08-25 22:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from mrs at apple dot com 2006-08-25 22:27 -------
Date: Fri, 25 Aug 2006 16:03:00 -0400
From: Jason Merrill <jason@redhat.com>
Subject: Re: RFA: Fix PR 28139
Message-id: <44EF5774.5050601@redhat.com>
This is OK.
:REVIEWURL http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01295.html:
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (7 preceding siblings ...)
2006-08-25 22:27 ` mrs at apple dot com
@ 2006-08-29 14:34 ` amylaar at gcc dot gnu dot org
2006-08-29 15:02 ` amylaar at gcc dot gnu dot org
2007-10-04 10:11 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-08-29 14:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from amylaar at gcc dot gnu dot org 2006-08-29 14:34 -------
Subject: Bug 28139
Author: amylaar
Date: Tue Aug 29 14:34:36 2006
New Revision: 116561
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116561
Log:
cp:
PR c++/28139
* except.c (expand_start_catch_block): Use correct types for bitwise
copy.
testsuite:
PR c++/28139
* g++.dg/eh/alias1.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/eh/alias1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/except.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (8 preceding siblings ...)
2006-08-29 14:34 ` amylaar at gcc dot gnu dot org
@ 2006-08-29 15:02 ` amylaar at gcc dot gnu dot org
2007-10-04 10:11 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-08-29 15:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from amylaar at gcc dot gnu dot org 2006-08-29 15:02 -------
Fixed on mainline; however, the problem was already present in 4.1, so we need
to decide if we want the patch in the 4.1 branch.
--
amylaar at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28139] alias information for EH is wrong
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
` (9 preceding siblings ...)
2006-08-29 15:02 ` amylaar at gcc dot gnu dot org
@ 2007-10-04 10:11 ` pinskia at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-04 10:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from pinskia at gcc dot gnu dot org 2007-10-04 10:11 -------
Fixed so closing.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Known to work|4.3.0 |4.3.0 4.2.0
Resolution| |FIXED
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28139
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-10-04 10:11 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-22 15:52 [Bug c++/28139] New: alias information for EH is wrong amylaar at gcc dot gnu dot org
2006-06-22 16:01 ` [Bug c++/28139] " amylaar at gcc dot gnu dot org
2006-06-22 16:34 ` pinskia at gcc dot gnu dot org
2006-06-22 16:39 ` pinskia at gcc dot gnu dot org
2006-06-22 16:58 ` amylaar at gcc dot gnu dot org
2006-06-22 23:36 ` amylaar at gcc dot gnu dot org
2006-06-29 21:43 ` patchapp at dberlin dot org
2006-07-03 16:39 ` amylaar at gcc dot gnu dot org
2006-08-25 22:27 ` mrs at apple dot com
2006-08-29 14:34 ` amylaar at gcc dot gnu dot org
2006-08-29 15:02 ` amylaar at gcc dot gnu dot org
2007-10-04 10:11 ` 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).