* [PATCH, CHKP, PR target/65183] Avoid wrong pass local data usage
@ 2015-02-25 9:36 Ilya Enkovich
2015-03-02 10:41 ` Ilya Enkovich
0 siblings, 1 reply; 4+ messages in thread
From: Ilya Enkovich @ 2015-02-25 9:36 UTC (permalink / raw)
To: gcc-patches
Hi,
This patch fixes a case when outdated checker local data is used to process external calls. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?
Thanks,
Ilya
--
gcc/
2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65183
* tree-chkp.c (chkp_check_lower): Don't check against
zero bounds for already instrumented functions.
(chkp_check_upper): Likewise.
(chkp_fini): Clean pass local data to avoid wrong reusage.
gcc/testsuite/
2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
PR target/65183
* gcc.target/i386/pr65183.c: New.
diff --git a/gcc/testsuite/gcc.target/i386/pr65183.c b/gcc/testsuite/gcc.target/i386/pr65183.c
new file mode 100644
index 0000000..069a543
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr65183.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target mpx } */
+/* { dg-options "-O -fcheck-pointer-bounds -fchkp-use-nochk-string-functions -mmpx" } */
+
+extern void bar(void *);
+extern void baz(void);
+
+static int lc[32];
+
+void foobar(void *c)
+{
+ bar(&c);
+ __builtin_memcpy (lc, c, lc[0]);
+}
+
+void foo ()
+{
+ baz ();
+ foobar(0);
+}
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
index b0a3a15..d2df4ba 100644
--- a/gcc/tree-chkp.c
+++ b/gcc/tree-chkp.c
@@ -1268,7 +1268,8 @@ chkp_check_lower (tree addr, tree bounds,
gimple check;
tree node;
- if (bounds == chkp_get_zero_bounds ())
+ if (!chkp_function_instrumented_p (current_function_decl)
+ && bounds == chkp_get_zero_bounds ())
return;
if (dirflag == integer_zero_node
@@ -1314,7 +1315,8 @@ chkp_check_upper (tree addr, tree bounds,
gimple check;
tree node;
- if (bounds == chkp_get_zero_bounds ())
+ if (!chkp_function_instrumented_p (current_function_decl)
+ && bounds == chkp_get_zero_bounds ())
return;
if (dirflag == integer_zero_node
@@ -4306,6 +4308,10 @@ chkp_fini (void)
free_dominance_info (CDI_POST_DOMINATORS);
bitmap_obstack_release (NULL);
+
+ entry_block = NULL;
+ zero_bounds = NULL_TREE;
+ none_bounds = NULL_TREE;
}
/* Main instrumentation pass function. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, CHKP, PR target/65183] Avoid wrong pass local data usage
2015-02-25 9:36 [PATCH, CHKP, PR target/65183] Avoid wrong pass local data usage Ilya Enkovich
@ 2015-03-02 10:41 ` Ilya Enkovich
2015-03-02 12:25 ` Maxim Kuvyrkov
0 siblings, 1 reply; 4+ messages in thread
From: Ilya Enkovich @ 2015-03-02 10:41 UTC (permalink / raw)
To: gcc-patches
Committed to trunk.
2015-02-25 12:19 GMT+03:00 Ilya Enkovich <enkovich.gnu@gmail.com>:
> Hi,
>
> This patch fixes a case when outdated checker local data is used to process external calls. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?
>
> Thanks,
> Ilya
> --
> gcc/
>
> 2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
>
> PR target/65183
> * tree-chkp.c (chkp_check_lower): Don't check against
> zero bounds for already instrumented functions.
> (chkp_check_upper): Likewise.
> (chkp_fini): Clean pass local data to avoid wrong reusage.
>
> gcc/testsuite/
>
> 2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
>
> PR target/65183
> * gcc.target/i386/pr65183.c: New.
>
>
> diff --git a/gcc/testsuite/gcc.target/i386/pr65183.c b/gcc/testsuite/gcc.target/i386/pr65183.c
> new file mode 100644
> index 0000000..069a543
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/pr65183.c
> @@ -0,0 +1,20 @@
> +/* { dg-do compile } */
> +/* { dg-require-effective-target mpx } */
> +/* { dg-options "-O -fcheck-pointer-bounds -fchkp-use-nochk-string-functions -mmpx" } */
> +
> +extern void bar(void *);
> +extern void baz(void);
> +
> +static int lc[32];
> +
> +void foobar(void *c)
> +{
> + bar(&c);
> + __builtin_memcpy (lc, c, lc[0]);
> +}
> +
> +void foo ()
> +{
> + baz ();
> + foobar(0);
> +}
> diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
> index b0a3a15..d2df4ba 100644
> --- a/gcc/tree-chkp.c
> +++ b/gcc/tree-chkp.c
> @@ -1268,7 +1268,8 @@ chkp_check_lower (tree addr, tree bounds,
> gimple check;
> tree node;
>
> - if (bounds == chkp_get_zero_bounds ())
> + if (!chkp_function_instrumented_p (current_function_decl)
> + && bounds == chkp_get_zero_bounds ())
> return;
>
> if (dirflag == integer_zero_node
> @@ -1314,7 +1315,8 @@ chkp_check_upper (tree addr, tree bounds,
> gimple check;
> tree node;
>
> - if (bounds == chkp_get_zero_bounds ())
> + if (!chkp_function_instrumented_p (current_function_decl)
> + && bounds == chkp_get_zero_bounds ())
> return;
>
> if (dirflag == integer_zero_node
> @@ -4306,6 +4308,10 @@ chkp_fini (void)
> free_dominance_info (CDI_POST_DOMINATORS);
>
> bitmap_obstack_release (NULL);
> +
> + entry_block = NULL;
> + zero_bounds = NULL_TREE;
> + none_bounds = NULL_TREE;
> }
>
> /* Main instrumentation pass function. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, CHKP, PR target/65183] Avoid wrong pass local data usage
2015-03-02 10:41 ` Ilya Enkovich
@ 2015-03-02 12:25 ` Maxim Kuvyrkov
2015-03-02 12:45 ` Ilya Enkovich
0 siblings, 1 reply; 4+ messages in thread
From: Maxim Kuvyrkov @ 2015-03-02 12:25 UTC (permalink / raw)
To: Ilya Enkovich; +Cc: gcc-patches
> On Mar 2, 2015, at 1:41 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>
> Committed to trunk.
Hi Ilya,
Was this approved offline? If so, it is a good habit to note in the "Committed to trunk" message who approved it. This way we have reviewer's name on file.
Thank you,
--
Maxim Kuvyrkov
www.linaro.org
>
> 2015-02-25 12:19 GMT+03:00 Ilya Enkovich <enkovich.gnu@gmail.com>:
>> Hi,
>>
>> This patch fixes a case when outdated checker local data is used to process external calls. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?
>>
>> Thanks,
>> Ilya
>> --
>> gcc/
>>
>> 2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
>>
>> PR target/65183
>> * tree-chkp.c (chkp_check_lower): Don't check against
>> zero bounds for already instrumented functions.
>> (chkp_check_upper): Likewise.
>> (chkp_fini): Clean pass local data to avoid wrong reusage.
>>
>> gcc/testsuite/
>>
>> 2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
>>
>> PR target/65183
>> * gcc.target/i386/pr65183.c: New.
>>
>>
>> diff --git a/gcc/testsuite/gcc.target/i386/pr65183.c b/gcc/testsuite/gcc.target/i386/pr65183.c
>> new file mode 100644
>> index 0000000..069a543
>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/i386/pr65183.c
>> @@ -0,0 +1,20 @@
>> +/* { dg-do compile } */
>> +/* { dg-require-effective-target mpx } */
>> +/* { dg-options "-O -fcheck-pointer-bounds -fchkp-use-nochk-string-functions -mmpx" } */
>> +
>> +extern void bar(void *);
>> +extern void baz(void);
>> +
>> +static int lc[32];
>> +
>> +void foobar(void *c)
>> +{
>> + bar(&c);
>> + __builtin_memcpy (lc, c, lc[0]);
>> +}
>> +
>> +void foo ()
>> +{
>> + baz ();
>> + foobar(0);
>> +}
>> diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
>> index b0a3a15..d2df4ba 100644
>> --- a/gcc/tree-chkp.c
>> +++ b/gcc/tree-chkp.c
>> @@ -1268,7 +1268,8 @@ chkp_check_lower (tree addr, tree bounds,
>> gimple check;
>> tree node;
>>
>> - if (bounds == chkp_get_zero_bounds ())
>> + if (!chkp_function_instrumented_p (current_function_decl)
>> + && bounds == chkp_get_zero_bounds ())
>> return;
>>
>> if (dirflag == integer_zero_node
>> @@ -1314,7 +1315,8 @@ chkp_check_upper (tree addr, tree bounds,
>> gimple check;
>> tree node;
>>
>> - if (bounds == chkp_get_zero_bounds ())
>> + if (!chkp_function_instrumented_p (current_function_decl)
>> + && bounds == chkp_get_zero_bounds ())
>> return;
>>
>> if (dirflag == integer_zero_node
>> @@ -4306,6 +4308,10 @@ chkp_fini (void)
>> free_dominance_info (CDI_POST_DOMINATORS);
>>
>> bitmap_obstack_release (NULL);
>> +
>> + entry_block = NULL;
>> + zero_bounds = NULL_TREE;
>> + none_bounds = NULL_TREE;
>> }
>>
>> /* Main instrumentation pass function. */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, CHKP, PR target/65183] Avoid wrong pass local data usage
2015-03-02 12:25 ` Maxim Kuvyrkov
@ 2015-03-02 12:45 ` Ilya Enkovich
0 siblings, 0 replies; 4+ messages in thread
From: Ilya Enkovich @ 2015-03-02 12:45 UTC (permalink / raw)
To: Maxim Kuvyrkov; +Cc: gcc-patches
2015-03-02 15:25 GMT+03:00 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>:
>> On Mar 2, 2015, at 1:41 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>
>> Committed to trunk.
>
>
> Hi Ilya,
>
> Was this approved offline? If so, it is a good habit to note in the "Committed to trunk" message who approved it. This way we have reviewer's name on file.
Hi,
I just self-approved this patch, thus no reviewer's name.
Thanks,
Ilya
>
> Thank you,
>
> --
> Maxim Kuvyrkov
> www.linaro.org
>
>
>>
>> 2015-02-25 12:19 GMT+03:00 Ilya Enkovich <enkovich.gnu@gmail.com>:
>>> Hi,
>>>
>>> This patch fixes a case when outdated checker local data is used to process external calls. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?
>>>
>>> Thanks,
>>> Ilya
>>> --
>>> gcc/
>>>
>>> 2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
>>>
>>> PR target/65183
>>> * tree-chkp.c (chkp_check_lower): Don't check against
>>> zero bounds for already instrumented functions.
>>> (chkp_check_upper): Likewise.
>>> (chkp_fini): Clean pass local data to avoid wrong reusage.
>>>
>>> gcc/testsuite/
>>>
>>> 2015-02-25 Ilya Enkovich <ilya.enkovich@intel.com>
>>>
>>> PR target/65183
>>> * gcc.target/i386/pr65183.c: New.
>>>
>>>
>>> diff --git a/gcc/testsuite/gcc.target/i386/pr65183.c b/gcc/testsuite/gcc.target/i386/pr65183.c
>>> new file mode 100644
>>> index 0000000..069a543
>>> --- /dev/null
>>> +++ b/gcc/testsuite/gcc.target/i386/pr65183.c
>>> @@ -0,0 +1,20 @@
>>> +/* { dg-do compile } */
>>> +/* { dg-require-effective-target mpx } */
>>> +/* { dg-options "-O -fcheck-pointer-bounds -fchkp-use-nochk-string-functions -mmpx" } */
>>> +
>>> +extern void bar(void *);
>>> +extern void baz(void);
>>> +
>>> +static int lc[32];
>>> +
>>> +void foobar(void *c)
>>> +{
>>> + bar(&c);
>>> + __builtin_memcpy (lc, c, lc[0]);
>>> +}
>>> +
>>> +void foo ()
>>> +{
>>> + baz ();
>>> + foobar(0);
>>> +}
>>> diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c
>>> index b0a3a15..d2df4ba 100644
>>> --- a/gcc/tree-chkp.c
>>> +++ b/gcc/tree-chkp.c
>>> @@ -1268,7 +1268,8 @@ chkp_check_lower (tree addr, tree bounds,
>>> gimple check;
>>> tree node;
>>>
>>> - if (bounds == chkp_get_zero_bounds ())
>>> + if (!chkp_function_instrumented_p (current_function_decl)
>>> + && bounds == chkp_get_zero_bounds ())
>>> return;
>>>
>>> if (dirflag == integer_zero_node
>>> @@ -1314,7 +1315,8 @@ chkp_check_upper (tree addr, tree bounds,
>>> gimple check;
>>> tree node;
>>>
>>> - if (bounds == chkp_get_zero_bounds ())
>>> + if (!chkp_function_instrumented_p (current_function_decl)
>>> + && bounds == chkp_get_zero_bounds ())
>>> return;
>>>
>>> if (dirflag == integer_zero_node
>>> @@ -4306,6 +4308,10 @@ chkp_fini (void)
>>> free_dominance_info (CDI_POST_DOMINATORS);
>>>
>>> bitmap_obstack_release (NULL);
>>> +
>>> + entry_block = NULL;
>>> + zero_bounds = NULL_TREE;
>>> + none_bounds = NULL_TREE;
>>> }
>>>
>>> /* Main instrumentation pass function. */
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-02 12:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-25 9:36 [PATCH, CHKP, PR target/65183] Avoid wrong pass local data usage Ilya Enkovich
2015-03-02 10:41 ` Ilya Enkovich
2015-03-02 12:25 ` Maxim Kuvyrkov
2015-03-02 12:45 ` Ilya Enkovich
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).