public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "dnovillo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/17007] New: Inconsistent builtin attributes set by Java front end
Date: Thu, 12 Aug 2004 16:56:00 -0000	[thread overview]
Message-ID: <20040812165640.17007.dnovillo@gcc.gnu.org> (raw)

The Java front end is not consistent in setting attributes for builtin
functions.  We rely on TREE_SIDE_EFFECTS and the ECF_* flags to determine
whether a function call will clobber all call-clobbered variables.

Applying the following patch to the operand scanner, will trigger several aborts
in libjava because of this.  It seems to me that neither TREE_SIDE_EFFECTS nor
ECF_* flags are correct out of the Java front end.

I am not familiar enough with the language to determine when it would be safe to
set these attributes.  Some seem obvious, but I'd rather leave this to someone
in Java land.

Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.29
diff -d -c -p -r2.29 tree-ssa-operands.c
*** tree-ssa-operands.c 12 Aug 2004 14:33:59 -0000      2.29
--- tree-ssa-operands.c 12 Aug 2004 16:55:59 -0000
*************** get_call_expr_operands (tree stmt, tree
*** 1373,1383 ****
        /* A 'pure' or a 'const' functions never call clobber anything.
         A 'noreturn' function might, but since we don't return anyway
         there is no point in recording that.  */
!       if (TREE_SIDE_EFFECTS (expr)
!         && !(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
!       add_call_clobber_ops (stmt);
        else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
!       add_call_read_ops (stmt);
      }
  }

--- 1373,1397 ----
        /* A 'pure' or a 'const' functions never call clobber anything.
         A 'noreturn' function might, but since we don't return anyway
         there is no point in recording that.  */
!       if (!(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
!       {
! #if defined ENABLE_CHECKING
!         /* If this is a clobbering call, it should have side-effects.  */
!         if (!TREE_SIDE_EFFECTS (expr))
!           abort ();
! #endif
!         add_call_clobber_ops (stmt);
!       }
        else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
!       {
! #if defined ENABLE_CHECKING
!         /* If this is not a clobbering call, it should not have
!            side-effects.  */
!         if (TREE_SIDE_EFFECTS (expr))
!           abort ();
! #endif
!         add_call_read_ops (stmt);
!       }
      }
  }

-- 
           Summary: Inconsistent builtin attributes set by Java front end
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dnovillo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


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


             reply	other threads:[~2004-08-12 16:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-12 16:56 dnovillo at gcc dot gnu dot org [this message]
2004-08-12 18:52 ` [Bug java/17007] " pinskia at gcc dot gnu dot org
2004-09-28 14:09 ` aph at gcc dot gnu dot org
2004-09-28 14:27 ` dnovillo at gcc dot gnu dot org
2004-09-28 14:38 ` aph at gcc dot gnu dot org
2004-09-29 14:13 ` cvs-commit at gcc dot gnu dot org
2004-09-29 14:14 ` aph at gcc dot gnu dot org
2004-10-04  2:53 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040812165640.17007.dnovillo@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).