[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#443576: Strict aliasing problem



Le 23.09.2007, à 10:22:15, Falk Hueffner a écrit:
> "Phil Endecott" <phil_dekje_endecott@chezphil.org> writes:
> 
> >> I think I found a bug in gcc-4.2
> >
> >> int i, j;
> >> printf("%d %d\n", j, (void *)(j));
> >
> > This looks like a strict-aliasing issue to me; you're casting from an
> > int to a void*, which is undefined.
> 
> Casting from int to void* is not undefined, but implementation
> defined. Also, this clearly has nothing to do with aliasing, since
> aliasing is about accessing objects using an lvalue of a bad type, and
> not about casting.
> 
> I would rather guess this is the same problem as #440545 (caused by a
> bug in SCEV).

It looks like the same bug. The bug was discovered when using the glib
GINT_TO_POINTER() macro. Exactly as in #440545.

The sample code provided in #440545 is also very similar to mine.

The upstream bug report (http://gcc.gnu.org/PR33381) has a patch
included.  So I hope the bug will not stay opened too long.


Maybe Debian will have to auto-rebuild the complete archive after the
bug is solved to remove any miss-compiled code.

Thanks

-- 
 Dr. Ludovic Rousseau                        Ludovic.Rousseau@free.fr
 -- Normaliser Unix c'est comme pasteuriser le camembert, L.R. --




Reply to: