This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: don't generate dead bytecode


Tom Tromey wrote:

>This patch almost fixes all the problems.  One remains:
>
>/x1/egcs/build/gcc/gcj -B/x1/egcs/build/i686-pc-linux-gnu/libjava/ -B/x1/egcs/build/gcc/ --encoding=UTF-8 --syntax-only ./java/io/ObjectInputStream.class
>java/io/ObjectInputStream.java: In class `java.io.ObjectInputStream':
>java/io/ObjectInputStream.java: In method `java.io.ObjectInputStream.dumpElement(java.lang.String)':
>java/io/ObjectInputStream.java:1538: warning: Unreachable bytecode from 3 to before 16.
>java/io/ObjectInputStream.java: In method `java.io.ObjectInputStream.dumpElementln(java.lang.String)':
>java/io/ObjectInputStream.java:1544: warning: Unreachable bytecode from 3 to before 16.
>
The problem is fundamentally that fold may create a SAVE_EXPR, which we 
can't use when
generating bytecode, because it would be too expensive to allocate a 
register for
a temp when we don't know when we can re-use it.  (It has been argued 
that SAVE_EXPR
is Bad Thing more generally, but I don't know of any plans to remove it.)

So patch_binop when generating bytecodes, to be safe, only calls fold 
when both operands
are constant. One fix to to do our own folding for '||' and '&&'.  I'll 
look into that.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]