Patchwork [asan,tsan] Don't ICE with -Og -fsanitize=address

login
register
mail settings
Submitter Jakub Jelinek
Date Nov. 27, 2012, 2:09 p.m.
Message ID <20121127140952.GC2315@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/202236/
State New
Headers show

Comments

Jakub Jelinek - Nov. 27, 2012, 2:09 p.m.
Hi!

I've noticed we don't schedule asan/tsan passes for -Og, which results in
ICEs.  For -O0 that is handled by pass_[at]san_O0, but for -Og which also
doesn't use the normal optimization queue there is nothing.

Ok for trunk?

2012-11-27  Jakub Jelinek  <jakub@redhat.com>

	* passes.c (init_optimization_passes): Add pass_asan and pass_tsan
	to -Og optimization passes.


	Jakub
Richard Guenther - Nov. 27, 2012, 2:12 p.m.
On Tue, Nov 27, 2012 at 3:09 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> I've noticed we don't schedule asan/tsan passes for -Og, which results in
> ICEs.  For -O0 that is handled by pass_[at]san_O0, but for -Og which also
> doesn't use the normal optimization queue there is nothing.
>
> Ok for trunk?

Ok.

Thanks,
Richard.

> 2012-11-27  Jakub Jelinek  <jakub@redhat.com>
>
>         * passes.c (init_optimization_passes): Add pass_asan and pass_tsan
>         to -Og optimization passes.
>
> --- gcc/passes.c.jj     2012-11-27 12:08:02.000000000 +0100
> +++ gcc/passes.c        2012-11-27 15:04:59.722410179 +0100
> @@ -1536,6 +1536,8 @@ init_optimization_passes (void)
>        /* Copy propagation also copy-propagates constants, this is necessary
>           to forward object-size results properly.  */
>        NEXT_PASS (pass_copy_prop);
> +      NEXT_PASS (pass_asan);
> +      NEXT_PASS (pass_tsan);
>        NEXT_PASS (pass_rename_ssa_copies);
>        NEXT_PASS (pass_dce);
>        /* Fold remaining builtins.  */
>
>         Jakub

Patch

--- gcc/passes.c.jj	2012-11-27 12:08:02.000000000 +0100
+++ gcc/passes.c	2012-11-27 15:04:59.722410179 +0100
@@ -1536,6 +1536,8 @@  init_optimization_passes (void)
       /* Copy propagation also copy-propagates constants, this is necessary
          to forward object-size results properly.  */
       NEXT_PASS (pass_copy_prop);
+      NEXT_PASS (pass_asan);
+      NEXT_PASS (pass_tsan);
       NEXT_PASS (pass_rename_ssa_copies);
       NEXT_PASS (pass_dce);
       /* Fold remaining builtins.  */