Bug 8260 - gcj -fprofile-arcs doesn't work
Summary: gcj -fprofile-arcs doesn't work
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Alexandre Oliva
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, patch
: 10987 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-10-17 10:06 UTC by owen
Modified: 2006-05-04 02:05 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-05-04 02:04:33


Attachments
test.java (103 bytes, text/plain)
2003-05-21 15:17 UTC, owen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description owen 2002-10-17 10:06:01 UTC
gcj doesn't seem to support -fprofile-arcs:

gcj -fprofile-arcs -ftest-coverage -g --main=test test.java
test.java:
Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

Release:
gcj 3.2

Environment:
redhat 7.3 linux x86 (2.4.18) smp

How-To-Repeat:
gcj -fprofile-arcs -ftest-coverage -g --main=test test.java
Comment 1 owen 2002-10-17 10:06:01 UTC
Fix:
none
Comment 2 Jeff Sturm 2002-10-17 15:42:02 UTC
From: Jeff Sturm <jsturm@one-point.com>
To: owen@schwartz-omalley.com
Cc: gcc-gnats@gcc.gnu.org, <gcc-prs@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>,
   <java-prs@gcc.gnu.org>
Subject: Re: java/8260: gcj -fprofile-arcs -ftest-coverage doesn't work
Date: Thu, 17 Oct 2002 15:42:02 -0400 (EDT)

 On 17 Oct 2002 owen@schwartz-omalley.com wrote:
 > gcj doesn't seem to support -fprofile-arcs:
 >
 > gcj -fprofile-arcs -ftest-coverage -g --main=test test.java
 > test.java:
 > Internal compiler error: Error reporting routines re-entered.
 > Please submit a full bug report,
 > with preprocessed source if appropriate.
 > See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 -fprofile-arcs is broken because the gcj frontend doesn't initialize
 long_integer_type_node.
 
 I've been using the following workaround, but haven't submitted since I'm
 not sure it's the right thing to do.  (I.e. is int_type_node or
 long_type_node the correct size for it?  These are java types, not C
 types.)
 
 Index: decl.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
 retrieving revision 1.132
 diff -u -r1.132 decl.c
 --- decl.c      21 Sep 2002 02:19:44 -0000      1.132
 +++ decl.c      17 Oct 2002 19:36:43 -0000
 @@ -426,7 +426,7 @@
    pushdecl (build_decl (TYPE_DECL, get_identifier ("byte"), byte_type_node));
    short_type_node = make_signed_type (16);
    pushdecl (build_decl (TYPE_DECL, get_identifier ("short"), short_type_node));
 -  int_type_node = make_signed_type (32);
 +  long_integer_type_node = int_type_node = make_signed_type (32);
    pushdecl (build_decl (TYPE_DECL, get_identifier ("int"), int_type_node));
    long_type_node = make_signed_type (64);
    pushdecl (build_decl (TYPE_DECL, get_identifier ("long"), long_type_node));
Comment 3 Andrew Pinski 2003-05-24 19:56:38 UTC
confirmed on mainline (20030524).
Comment 4 Andrew Pinski 2003-05-27 15:37:58 UTC
*** Bug 10987 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Pinski 2003-05-27 15:40:07 UTC
I changed the title because it really only -fprofile-arcs that is causing the problem.
Comment 6 Andrew Pinski 2004-05-10 16:31:32 UTC
Reconfirmed, this was discused on the mailing list recently (but I cannot find the 
reference),  basically the java front-end is not setting up some of the types right so Jeff's 
comments are not quite right.
Comment 7 Jeff Sturm 2004-05-10 20:30:21 UTC
(In reply to comment #6)
> Reconfirmed, this was discused on the mailing list recently (but I cannot find
the 
> reference),  basically the java front-end is not setting up some of the types
right so Jeff's 
> comments are not quite right.

Andrew, you probably mean the discussion following
http://gcc.gnu.org/ml/gcc-patches/2004-04/msg01913.html.

I think my original patch has the right idea, defining the missing (C) types,
but the discussion linked above debated whether java should be using
build_common_tree_nodes (I think it should, along with some variable renaming).
Comment 8 Andrew Pinski 2006-02-28 18:27:56 UTC
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2006-02/msg02043.html
Comment 9 Alexandre Oliva 2006-05-04 02:02:13 UTC
Subject: Bug 8260

Author: aoliva
Date: Thu May  4 02:02:01 2006
New Revision: 113512

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113512
Log:
PR java/8260
* coverage.c: Use get_gcov_unsigned_t() instead of
unsigned_type_node all over.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/coverage.c

Comment 10 Alexandre Oliva 2006-05-04 02:05:13 UTC
Fixed for 4.2.