Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-08-05 Thread Andreas Schwab
Martin Sebor mse...@gmail.com writes: gcc/testsuite/ChangeLog 2015-07-28 Martin Sebor mse...@redhat.com * g++.dg/Wframe-address-in-Wall.C: New test. * g++.dg/Wframe-address.C: New test. * g++.dg/Wno-frame-address.C: New test. * gcc.dg/Wframe-address-in-Wall.c: New test.

Re: Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-08-05 Thread Jiong Wang
On 28/07/15 16:44, Martin Sebor wrote: Attached is an updated patch with the changes above. gcc/testsuite/ChangeLog 2015-07-28 Martin Sebormse...@redhat.com * g++.dg/Wframe-address-in-Wall.C: New test. * g++.dg/Wframe-address.C: New test. * g++.dg/Wno-frame-address.C: New

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-08-05 Thread Martin Sebor
On 08/05/2015 10:02 AM, Jiong Wang wrote: On 28/07/15 16:44, Martin Sebor wrote: Attached is an updated patch with the changes above. gcc/testsuite/ChangeLog 2015-07-28 Martin Sebormse...@redhat.com * g++.dg/Wframe-address-in-Wall.C: New test. * g++.dg/Wframe-address.C: New

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-08-02 Thread Martin Sebor
OK for the trunk. Sorry for the delay. Thank you. Committed in revision 226480. Martin

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-31 Thread Jeff Law
On 07/28/2015 09:44 AM, Martin Sebor wrote: gcc/ChangeLog 2015-07-27 Martin Sebor mse...@redhat.com * c-family/c.opt (-Wbuiltin-address): New warning option. * doc/invoke.texi (Wbuiltin-address): Document it. * doc/extend.texi (__builtin_frame_addrress,

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-28 Thread Segher Boessenkool
On Mon, Jul 27, 2015 at 09:08:34PM -0600, Martin Sebor wrote: So, my suggestion would be to warn for any call with a nonzero value. The current documentation says that you should only use nonzero values for debug purposes. A warning would help yes, how many people read the manual after all

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-28 Thread Martin Sebor
gcc/ChangeLog 2015-07-27 Martin Sebor mse...@redhat.com * c-family/c.opt (-Wbuiltin-address): New warning option. * doc/invoke.texi (Wbuiltin-address): Document it. * doc/extend.texi (__builtin_frame_addrress, __builtin_return_addrress): Typoes (rr). Fixed. - rtx

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-27 Thread Martin Sebor
So, my suggestion would be to warn for any call with a nonzero value. The current documentation says that you should only use nonzero values for debug purposes. A warning would help yes, how many people read the manual after all :-) Thank you both for the feedback. Attached is a simplified

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-25 Thread Segher Boessenkool
On Thu, Jul 23, 2015 at 11:08:21PM -0600, Jeff Law wrote: There's the following comment in expand_builtin_frame_address: /* Some ports cannot access arbitrary stack frames. */ just before a block of code where the function can lead to an invalid argument warning which would cause

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-23 Thread Jeff Law
On 06/11/2015 04:05 PM, Martin Sebor wrote: Attached is an updated patch for both GCC and the manual. The patch implements the suggested warning, -Wbuiltin-address, that issues diagnostics for unsafe calls of the builtin address functions. Safe calls are those with arguments 0 or 1 anywhere in

Re: [PING 3] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-07 Thread Pedro Alves
On 07/07/2015 04:41 AM, Martin Sebor wrote: This is a small change to diagnose unsafe calls to __builtin_{frame,return}_address (with an argument 2) than tend to return bogus values or lead to crashes at runtime. I hadn't realized you went through and implemented the suggestion. Thanks for

[PING 3] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-07-06 Thread Martin Sebor
This is a small change to diagnose unsafe calls to __builtin_{frame,return}_address (with an argument 2) than tend to return bogus values or lead to crashes at runtime. A review would be appreciated. Thanks Martin On 06/26/2015 05:49 PM, Martin Sebor wrote: Is this patch okay for trunk? On

Re: [PING 2] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-06-26 Thread Martin Sebor
Is this patch okay for trunk? On 06/18/2015 11:15 AM, Martin Sebor wrote: Are there any concerns with or suggestions for changes to the following patch? https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00886.html Thanks Martin

[PING] Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-06-18 Thread Martin Sebor
Are there any concerns with or suggestions for changes to the following patch? https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00886.html Thanks Martin

Re: [PATCH] warn for unsafe calls to __builtin_return_address

2015-06-11 Thread Martin Sebor
Attached is an updated patch for both GCC and the manual. The patch implements the suggested warning, -Wbuiltin-address, that issues diagnostics for unsafe calls of the builtin address functions. Safe calls are those with arguments 0 or 1 anywhere in a program and argument 2 outside of the main