public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/14863] [3.4 regression] unit-at-a-time causes miscompilation
Date: Wed, 02 Jun 2004 11:54:00 -0000	[thread overview]
Message-ID: <20040602115447.8581.qmail@sourceware.org> (raw)
In-Reply-To: <20040406114325.14863.rguenth@tat.physik.uni-tuebingen.de>


------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de  2004-06-02 11:54 -------
Subject: Re:  [3.4 regression] unit-at-a-time
 causes miscompilation

On Wed, 2 Jun 2004, belyshev at lubercy dot com wrote:

>
> ------- Additional Comments From belyshev at lubercy dot com  2004-06-02 11:15 -------
> >The minimized testcase is of course invalid.  I'm currently investigating
>
> I would not say that. Consider:

While I don't understand what you are hinting at here, looking at the
actual code doesn't reveal any obvious failure in handling invalid data,
still valgrind tells us:

==21613== Invalid read of size 4
==21613==    at 0x804E6EF: void Engine<1, int,
Dynamic>::performDestroy<IntervalIterator>(IntervalIterator const&,
IntervalIterator const&, BackFill const&, bool)
(/home/rguenth/src/pooma-bk/r2/src/Utilities/algorithms.h:233)
==21613==    by 0x804EE9E: void Engine<1, int,
Dynamic>::performDestroy<Interval<1> >(Interval<1> const&, BackFill
const&, bool)
(/home/rguenth/src/pooma-bk/r2/src/Engine/DynamicEngine.cpp:254)
==21613==    by 0x804EF44: void Engine<1, int,
Dynamic>::destroy<Interval<1> >(Interval<1> const&)
(/home/rguenth/src/pooma-bk/r2/src/Layout/DynamicEvents.h:127)
==21613==    by 0x804F11F:
Particles<MPDynamicUniform>::performDestroy(int, bool)
(/home/rguenth/src/pooma-bk/r2/src/Array/Array.h:2201)
==21613==    by 0x8049E1A: main (bctest3.cpp:143)
==21613==  Address 0xBFFFEF3C is just below %esp.  Possibly a bug in
GCC/G++
==21613==   v 2.96 or 3.0.X.  To suppress, use:
--workaround-gcc296-bugs=yes
==21613==
==21613== Invalid write of size 4
==21613==    at 0x804E77E: void Engine<1, int,
Dynamic>::performDestroy<IntervalIterator>(IntervalIterator const&,
IntervalIterator const&, BackFill const&, bool)
(/home/rguenth/src/pooma-bk/r2/src/Utilities/RefCountedBlockPtr.h:635)
==21613==    by 0x804EE9E: void Engine<1, int,
Dynamic>::performDestroy<Interval<1> >(Interval<1> const&, BackFill
const&, bool)
(/home/rguenth/src/pooma-bk/r2/src/Engine/DynamicEngine.cpp:254)
==21613==    by 0x804EF44: void Engine<1, int,
Dynamic>::destroy<Interval<1> >(Interval<1> const&)
(/home/rguenth/src/pooma-bk/r2/src/Layout/DynamicEvents.h:127)
==21613==    by 0x804F11F:
Particles<MPDynamicUniform>::performDestroy(int, bool)
(/home/rguenth/src/pooma-bk/r2/src/Array/Array.h:2201)
==21613==    by 0x8049E1A: main (bctest3.cpp:143)
==21613==  Address 0x60F177E4 is not stack'd, malloc'd or free'd
==21613==
==21613== Process terminating with default action of signal 11 (SIGSEGV):
dumping core

which is at src/Utilities/algorithms.h:233 - I remember looking at this
stuff and was not able to come to the conclusion that this part of
(arguably ugly) code is wrong.  Oh - of course POOMA_NONSTANDARD_ITERATOR
is zero.  The exact signature of the performDestroy is

void Engine<(int)1, int, Dynamic>::performDestroy<IntervalIterator>
  (IntervalIterator const&, IntervalIterator const&, BackFill const&, bool)

we have inlined the delete_backfill method here (probably the key of the
failure, marking the delete_backfill __attribute__((noinline)) "fixes"
the failure).

Maybe we are wrongly re-using some stack slots here?  Or is it possible
for (source) code to become invalid wrt references to temporaries after
inlining?

I'm confused.

Richard.


-- 


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


  parent reply	other threads:[~2004-06-02 11:54 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 11:43 [Bug optimization/14863] New: " rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-06 11:45 ` [Bug optimization/14863] " rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-06 11:49 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-06 12:36 ` pinskia at gcc dot gnu dot org
2004-04-06 23:48 ` 1319 at bot dot ru
2004-04-07  7:59 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-07  8:00 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-07  8:04 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-07 10:25 ` 1319 at bot dot ru
2004-04-07 11:56 ` 1319 at bot dot ru
2004-04-07 12:04 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-07 13:07 ` [Bug optimization/14863] [3.4/3.5 " pinskia at gcc dot gnu dot org
2004-04-07 13:26 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-07 13:37 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-07 13:44 ` giovannibajo at libero dot it
2004-04-07 16:08 ` pinskia at gcc dot gnu dot org
2004-04-07 20:55 ` pinskia at gcc dot gnu dot org
2004-04-08 11:57 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-08 11:58 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-09 13:09 ` pinskia at gcc dot gnu dot org
2004-04-09 13:12 ` pinskia at gcc dot gnu dot org
2004-04-09 13:35 ` pinskia at gcc dot gnu dot org
2004-04-10 15:27 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-04-11  1:06 ` 1319 at bot dot ru
2004-06-02  0:08 ` [Bug rtl-optimization/14863] " belyshev at lubercy dot com
2004-06-02  0:19 ` [Bug rtl-optimization/14863] [3.4 " pinskia at gcc dot gnu dot org
2004-06-02  6:47 ` belyshev at lubercy dot com
2004-06-02  7:38 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-06-02  8:50 ` belyshev at lubercy dot com
2004-06-02 10:18 ` giovannibajo at libero dot it
2004-06-02 10:51 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-06-02 10:57 ` giovannibajo at libero dot it
2004-06-02 11:07 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-06-02 11:14 ` giovannibajo at libero dot it
2004-06-02 11:15 ` belyshev at lubercy dot com
2004-06-02 11:54 ` rguenth at tat dot physik dot uni-tuebingen dot de [this message]
2004-06-02 12:05 ` rguenth at tat dot physik dot uni-tuebingen dot de
2004-06-02 22:30 ` pinskia at gcc dot gnu dot org
2004-06-03  1:01 ` [Bug rtl-optimization/14863] [3.4/3.5 " giovannibajo at libero dot it
2004-06-03  1:08 ` pinskia at gcc dot gnu dot org
2004-06-03  1:12 ` pinskia at gcc dot gnu dot org
2004-06-03  1:25 ` giovannibajo at libero dot it
2004-06-04 20:47 ` giovannibajo at libero dot it

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=20040602115447.8581.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).