public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <20040121055330.13788.meganandaj@pacific.net.au>]
* [Bug java/13788] New: Zero propogate right shift in static final int initializer causes error
@ 2004-01-21  5:53 andrew dot gray at anu dot edu dot au
  2004-01-21  6:03 ` [Bug java/13788] " pinskia at gcc dot gnu dot org
  2004-01-21  6:17 ` andrew dot gray at anu dot edu dot au
  0 siblings, 2 replies; 9+ messages in thread
From: andrew dot gray at anu dot edu dot au @ 2004-01-21  5:53 UTC (permalink / raw)
  To: gcc-bugs

Overview description
--------------------
Using the zero propogate right shift operator (>>>) with constant operands
in a static final int initializer causes a compilation error in gcj.

Steps to reproduce
------------------
1) Create the RShiftInInitializer.java source file with the following contents:

class RShiftInIntInitializer {
  private static final int  DUMMY1 = 1 >>> 1;

  public static void main(String [] args) {
    System.out.println(DUMMY1);
  }
}

2) Run the following gcj command:
gcj --main=RShiftInIntInitializer RShiftInIntInitializer.java

Actual results
--------------
The gcj command produced the following output:
RShiftInIntInitializer.java: In class `RShiftInIntInitializer':
RShiftInIntInitializer.java: In method `<clinit>()':
RShiftInIntInitializer.java:2: error: Incompatible type for declaration.
Explicit cast needed to convert `unsigned int' to `int'.
     private static final int  DUMMY1 = 1 >>> 1;
                               ^
1 error

Expected results
----------------
I expect gcj to produce no error messages and create an a.out file that when
run would produce the following output:
0
This is what happened when I used the javac and java tools from Sun's J2SE SDK
v1.4.1 to compile and run the RShiftInInitializer.java code.

Version and platform
--------------------
Version of GCC: 3.4.0 20040114 (experimental)

System type: i686-pc-linux-gnu

Options given when GCC was configured:
../gcc-3.4-20040114/configure --prefix=/home/andrewg/gcc-3.4-20040114-install
--enable-threads=posix --enable-shared --enable-languages=c++,java

The problem was also seen with the following versions of GCC:
3.2.2 20030222 (Red Hat Linux 3.2.2-5)
3.3.2

-- 
           Summary: Zero propogate right shift in static final int
                    initializer causes error
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot gray at anu dot edu dot au
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13788


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-10-13  1:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-13788-7763@http.gcc.gnu.org/bugzilla/>
2005-10-13  1:11 ` [Bug java/13788] Zero propogate right shift in static final int initializer causes error cvs-commit at gcc dot gnu dot org
2005-10-13  1:14 ` mckinlay at redhat dot com
     [not found] <20040121055330.13788.meganandaj@pacific.net.au>
2005-06-24 21:49 ` tromey at gcc dot gnu dot org
2005-06-27 16:52 ` tromey at gcc dot gnu dot org
2005-06-27 16:59 ` tromey at gcc dot gnu dot org
2005-06-27 18:40 ` cvs-commit at gcc dot gnu dot org
2005-06-27 18:41 ` tromey at gcc dot gnu dot org
2004-01-21  5:53 [Bug java/13788] New: " andrew dot gray at anu dot edu dot au
2004-01-21  6:03 ` [Bug java/13788] " pinskia at gcc dot gnu dot org
2004-01-21  6:17 ` andrew dot gray at anu dot edu dot au

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).