public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* patch that caused regression PR c/8730
@ 2002-12-24 21:29 Janis Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Janis Johnson @ 2002-12-24 21:29 UTC (permalink / raw)
  To: gcc, kenner

The regression reported in PR c/8730 showed up starting
with this large patch from long, long ago:

Sat Nov 27 08:38:26 1999  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* fold-const.c (negate_expr, associate_trees, extract_muldiv): New.
	(split_tree): Completely rework to make more general.
	(make_range, fold): Call negate_expr.
	(fold, case NEGATE_EXPR): Simplify -(a-b) is -ffast-math.
	(fold, associate): Call new split_tree and associate_trees.
	(fold, case MULT_EXPR, case *_{DIV,MOD}_EXPR): Call extract_muldiv.

Here's a small test case that causes the compiler to ICE when compiled
on i686-linux with the mainline:

-------------------
void foo() {
  void *bar (int i, int A[1][i]) { return A[0]; };
};
-------------------

The same patch causes the behavior to change with the
submitter's larger test case.

Output from the the mainline:

8730.c: In function `bar':
8730.c:2: internal compiler error: in expand_expr, at expr.c:6823
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

I've added this information to the PR.

Janis

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

* Re:  patch that caused regression PR c/8730
@ 2002-12-25 18:12 Richard Kenner
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Kenner @ 2002-12-25 18:12 UTC (permalink / raw)
  To: janis187; +Cc: gcc

    The regression reported in PR c/8730 showed up starting
    with this large patch from long, long ago:

    Sat Nov 27 08:38:26 1999  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* fold-const.c (negate_expr, associate_trees, extract_muldiv): New.

    void foo() {
      void *bar (int i, int A[1][i]) { return A[0]; };
    };

I looked at this and am quite confused how this is supposed to work with the
new function-at-a-time processing.  I don't understand how the above patch
related to this, though.

What's happening is that a SAVE_EXPR is being made to compute the size of
the inner array.  Its SAVE_EXPR_CONTEXT is foo, not bar, but when it's 
evaluated for the first time in bar, it blows up.

It's true that SAVE_EXPR is made in extract_muldiv, but it's made from a
SAVE_EXPR that has the save SAVE_EXPR_CONTEXT.

I believe that these SAVE_EXPRs should have SAVE_EXPR_CONTEXT of bar, the
inner function.

Somebody who understand the C front end's function-at-a-time handling should
look at this.

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

end of thread, other threads:[~2002-12-25  0:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-24 21:29 patch that caused regression PR c/8730 Janis Johnson
2002-12-25 18:12 Richard Kenner

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