This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/20593] [4.0/4.1 Regression] Simple array of string access miscompiled on x86 and x86_64 and PPC
- From: "kenner at vlsi1 dot ultra dot nyu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2005 22:45:55 -0000
- Subject: [Bug ada/20593] [4.0/4.1 Regression] Simple array of string access miscompiled on x86 and x86_64 and PPC
- References: <20050322192938.20593.laurent@guerby.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kenner at vlsi1 dot ultra dot nyu dot edu 2005-03-22 22:45 -------
Subject: Re: [4.0/4.1 Regression] Simple array of string access miscompiled on x86 and x86_64 and PPC
Here's the fix. Will check in shortly. Note that the handling of
'Unrestricted_Access in Gigi isn't what the front end expects. That's a
simple fix that will also fix this problem, but the below is also a good
idea ...
*** varasm.c 22 Mar 2005 01:10:54 -0000 1.485
--- varasm.c 22 Mar 2005 22:04:45 -0000
*************** compute_reloc_for_constant (tree exp)
*** 3363,3366 ****
--- 3363,3367 ----
case CONVERT_EXPR:
case NON_LVALUE_EXPR:
+ case VIEW_CONVERT_EXPR:
reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0));
break;
*************** output_addressed_constants (tree exp)
*** 3419,3422 ****
--- 3420,3424 ----
case CONVERT_EXPR:
case NON_LVALUE_EXPR:
+ case VIEW_CONVERT_EXPR:
output_addressed_constants (TREE_OPERAND (exp, 0));
break;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20593