public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/17007] New: Inconsistent builtin attributes set by Java front end
@ 2004-08-12 16:56 dnovillo at gcc dot gnu dot org
  2004-08-12 18:52 ` [Bug java/17007] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-08-12 16:56 UTC (permalink / raw)
  To: java-prs

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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
@ 2004-08-12 18:52 ` pinskia at gcc dot gnu dot org
  2004-09-28 14:09 ` aph at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-12 18:52 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-12 18:52 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-08-12 18:52:29
               date|                            |


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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-09-28 14:09 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From aph at gcc dot gnu dot org  2004-09-28 14:09 -------
Diego, I need more information.  How can a builtin clobber a variable?  I don't
get it.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aph at gcc dot gnu dot org


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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-09-28 14:27 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-09-28 14:27 -------

What I want out of the Java FE is to set ECF_* flags accordingly.  If a builtin
function is not going to have side-effects, not only it should have
TREE_SIDE_EFFECTS = 0, but it'd be nice if it also set one of the ECF_* flags,
so that we can have the checks suggested in this patch.

-- 


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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-09-28 14:38 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2004-08-12 18:52:29         |2004-09-28 14:38:49
               date|                            |


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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-09-29 14:13 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-09-29 14:13 -------
Subject: Bug 17007

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aph@gcc.gnu.org	2004-09-29 14:13:18

Modified files:
	gcc/java       : ChangeLog decl.c parse.y 

Log message:
	2004-09-29  Andrew Haley  <aph@redhat.com>
	
	PR java/17007
	* parse.y (patch_binop): Don't mess with the TREE_SIDE_EFFECTS of the
	result of TRUNC_MOD_EXPR.
	(patch_unaryop): Likewise for CONVERT_EXPR, which may throw.
	* decl.c (java_init_decl_processing): Mark
	soft_lookupinterfacemethod_node and soft_instanceof_node pure.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1469&r2=1.1470
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/decl.c.diff?cvsroot=gcc&r1=1.197&r2=1.198
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.512&r2=1.513



-- 


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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: aph at gcc dot gnu dot org @ 2004-09-29 14:14 UTC (permalink / raw)
  To: java-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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


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

* [Bug java/17007] Inconsistent builtin attributes set by Java front end
  2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-09-29 14:14 ` aph at gcc dot gnu dot org
@ 2004-10-04  2:53 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-04  2:53 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-04 02:53 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2004-10-04  2:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-12 16:56 [Bug java/17007] New: Inconsistent builtin attributes set by Java front end dnovillo at gcc dot gnu dot org
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

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