[patch] Do not call output_constant from the front end

Steven Bosscher stevenb.gcc@gmail.com
Tue Mar 27 20:36:00 GMT 2012


The Java front end emits assembly from class.c:emit_register_classes()
to fill the .jcr section. This is not something a front end ought to
be doing. Things to write out to the assembler output file should go
through the varpool/varasm mechanism. The attached patch makes
emit_register_classes build a constructor for the .jcr section, and
stops it calling output_constant.

The patch passes build+testing on powerpc64-unknown-linux-gnu.

With this patch a variable named "_Jv_CLS" is written out. The
assembly before and after the patch is the same, except for the
variable name. I want to write out a nameless variable but I don't
know how. Help welcome.


        PR java/52730
        * class.c (emit_register_classes_in_jcr_section): New function.
        (emit_Jv_RegisterClass_calls): New function, split out from ...
        (emit_register_classes): ... here.  Reorganize.  Do not call
-------------- next part --------------
A non-text attachment was scrubbed...
Name: java_no_output_constant.diff
Type: text/x-patch
Size: 4810 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120327/3669c6cb/attachment.bin>

More information about the Gcc-patches mailing list