This is the mail archive of the
mailing list for the GCC project.
64 bit mudflap failures
- From: Andreas Krebbel <krebbel1 at de dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: roger at eyesopen dot com
- Date: Fri, 7 Jan 2005 09:51:27 +0100
- Subject: 64 bit mudflap failures
- Organization: IBM Deutschland Entwicklung GmbH
there are three new mudflap failures on s390x (64bit). I think at least one of
them is caused by this patch:
> 2005-01-01 Roger Sayle <email@example.com>
> Olivier Hainque <firstname.lastname@example.org>
> * tree.c (int_fits_type_p): A narrower type always fits in a
> wider one, except for negative values into unsigned types.
The variable "foo" in the following testcase is not instrumented by mudflap
because it is not marked addressable:
int main ()
volatile int foo ;
foo = 0;
It should be marked addressable by this code:
if (TREE_CODE (index) == INTEGER_CST
&& TYPE_DOMAIN (TREE_TYPE (array))
&& !int_fits_type_p (index, TYPE_DOMAIN (TREE_TYPE (array))))
if (!c_mark_addressable (array))
int_fits_type_p should recognize that the index does not fit in the array index
type but it fails to do due to the following check (introduced by the patch):
int_fits_type_p (tree c, tree type)
/* Second, narrower types always fit in wider ones. */
if (TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (c)))
The precision of the constant's type is set to INT_TYPE_SIZE which is 32 (set in s390.h).
The precision of the index type is set in build_index_type to the precision
of sizetype which is the precision of unsigned long (64, set in set_sizetypes).
I don't say introducing that check was wrong because it seems sensible to me, but
it unfortunately causes the mentioned failure.
Perhaps changing the precision of constants would be a solution, but I've no idea how that
would impact other code.