[patch] ipa-type-escape improvements

Eric Botcazou ebotcazou@adacore.com
Tue Mar 13 23:50:00 GMT 2007


> +2007-03-01  Olga Golovanevsky  <olga@il.ibm.com>
> +
> +     * tree.h : Add multiple_of_p declaration.
> +     * fold-const.c (multiple_of_p): Make multiple_of_p public.
> +     * ipa-type-escape.c (results_of_malloc): Redundant.
> +     (visited_stmts): New. Visited stmt for walk_use_def_chains.
> +     (cast_type): Extended with new members.
> +     (check_cast): Returns cast_type.
> +     (cast): New structure for data of walk_use_def_chains.
> +     (is_malloc_result, is_cast_from_non_pointer_1,
> +     is_cast_from_non_pointer,
> +     is_array_access_through_pointer_and_index): New functions.
> +     (look_for_casts): Returns cast types.
> +     (check_call): Returns void.
> +     (okay_pointer_operation): Use support of pointer plus index,
> +     pointer plus constant and allow all multiplications.

This breaks Ada on x86 with tree checking enabled.  To reproduce, compile the 
attached reproducer in the objdir directory with:

gcc/xgcc -Bgcc -S -O2 -gnatpg a-numaux.adb -Igcc/ada/rts

+===========================GNAT BUG DETECTED==============================+
| 4.3.0 20070313 (experimental) (i586-suse-linux-gnu) GCC error:           |
| tree check: expected class 'expression', have 'constant' (real_cst)      |
|     in look_for_casts, at ipa-type-escape.c:1249                         |
| Error detected at a-numaux.adb:37:1                   

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a-numaux.ads
Type: text/x-adasrc
Size: 182 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070313/e2f375d8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a-numaux.adb
Type: text/x-adasrc
Size: 1169 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070313/e2f375d8/attachment-0001.bin>


More information about the Gcc-patches mailing list