* [Bug java/64044] Java emits bogus .class$ decls
2014-11-24 10:32 [Bug java/64044] New: Java emits bogus .class$ decls rguenth at gcc dot gnu.org
@ 2014-11-24 10:35 ` rguenth at gcc dot gnu.org
2014-11-24 10:38 ` aph at redhat dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24 10:35 UTC (permalink / raw)
To: java-prs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Simple patch to reproduce the issue:
Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c (revision 218005)
+++ gcc/gimple-fold.c (working copy)
@@ -255,7 +255,8 @@ get_symbol_constant_value (tree sym)
overridden at link or run time. */
if (!val
&& (INTEGRAL_TYPE_P (TREE_TYPE (sym))
- || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))))
+ || SCALAR_FLOAT_TYPE_P (TREE_TYPE (sym))
+ || POINTER_TYPE_P (TREE_TYPE (sym))))
return build_zero_cst (TREE_TYPE (sym));
}
it should use && is_gimple_reg_type (TREE_TYPE (sym)) in the end.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug java/64044] Java emits bogus .class$ decls
2014-11-24 10:32 [Bug java/64044] New: Java emits bogus .class$ decls rguenth at gcc dot gnu.org
2014-11-24 10:35 ` [Bug java/64044] " rguenth at gcc dot gnu.org
@ 2014-11-24 10:38 ` aph at redhat dot com
2014-11-24 10:39 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: aph at redhat dot com @ 2014-11-24 10:38 UTC (permalink / raw)
To: java-prs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
Andrew Haley <aph at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aph at redhat dot com
--- Comment #2 from Andrew Haley <aph at redhat dot com> ---
So, is the solution to this trivially not to mark the .class$ decls as
TREE_CONST ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug java/64044] Java emits bogus .class$ decls
2014-11-24 10:32 [Bug java/64044] New: Java emits bogus .class$ decls rguenth at gcc dot gnu.org
2014-11-24 10:35 ` [Bug java/64044] " rguenth at gcc dot gnu.org
2014-11-24 10:38 ` aph at redhat dot com
@ 2014-11-24 10:39 ` rguenth at gcc dot gnu.org
2014-11-24 10:50 ` rguenther at suse dot de
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24 10:39 UTC (permalink / raw)
To: java-prs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Suggested fix:
Index: gcc/java/class.c
===================================================================
--- gcc/java/class.c (revision 218005)
+++ gcc/java/class.c (working copy)
@@ -1084,8 +1084,6 @@ build_classdollar_field (tree type)
TYPE_QUAL_CONST)),
TYPE_QUAL_CONST)));
TREE_STATIC (decl) = 1;
- TREE_CONSTANT (decl) = 1;
- TREE_READONLY (decl) = 1;
TREE_PUBLIC (decl) = 1;
java_hide_decl (decl);
DECL_IGNORED_P (decl) = 1;
not sure why it doesn't end up in .rodata.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug java/64044] Java emits bogus .class$ decls
2014-11-24 10:32 [Bug java/64044] New: Java emits bogus .class$ decls rguenth at gcc dot gnu.org
` (2 preceding siblings ...)
2014-11-24 10:39 ` rguenth at gcc dot gnu.org
@ 2014-11-24 10:50 ` rguenther at suse dot de
2014-11-24 11:28 ` aph at gcc dot gnu.org
2014-11-24 14:02 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenther at suse dot de @ 2014-11-24 10:50 UTC (permalink / raw)
To: java-prs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 24 Nov 2014, aph at redhat dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
>
> Andrew Haley <aph at redhat dot com> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |aph at redhat dot com
>
> --- Comment #2 from Andrew Haley <aph at redhat dot com> ---
> So, is the solution to this trivially not to mark the .class$ decls as
> TREE_CONST ?
Yes, see the patch I proposed (in testing right now, I'll post it
and ask for approval later today unless you want to pre-approve here)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug java/64044] Java emits bogus .class$ decls
2014-11-24 10:32 [Bug java/64044] New: Java emits bogus .class$ decls rguenth at gcc dot gnu.org
` (3 preceding siblings ...)
2014-11-24 10:50 ` rguenther at suse dot de
@ 2014-11-24 11:28 ` aph at gcc dot gnu.org
2014-11-24 14:02 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: aph at gcc dot gnu.org @ 2014-11-24 11:28 UTC (permalink / raw)
To: java-prs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
--- Comment #5 from Andrew Haley <aph at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #4)
> On Mon, 24 Nov 2014, aph at redhat dot com wrote:
>
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
> >
> > Andrew Haley <aph at redhat dot com> changed:
> >
> > What |Removed |Added
> > ----------------------------------------------------------------------------
> > CC| |aph at redhat dot com
> >
> > --- Comment #2 from Andrew Haley <aph at redhat dot com> ---
> > So, is the solution to this trivially not to mark the .class$ decls as
> > TREE_CONST ?
>
> Yes, see the patch I proposed (in testing right now, I'll post it
> and ask for approval later today unless you want to pre-approve here)
Fine by me. I did that because I wanted some way to tell GCC that it could
treat the field as readonly, but TREE_CONST doesn't do that.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug java/64044] Java emits bogus .class$ decls
2014-11-24 10:32 [Bug java/64044] New: Java emits bogus .class$ decls rguenth at gcc dot gnu.org
` (4 preceding siblings ...)
2014-11-24 11:28 ` aph at gcc dot gnu.org
@ 2014-11-24 14:02 ` rguenth at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24 14:02 UTC (permalink / raw)
To: java-prs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64044
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk.
^ permalink raw reply [flat|nested] 7+ messages in thread