PR c++/36254 wrong "control reaches end of non-void function" warning

Manuel López-Ibáñez lopezibanez@gmail.com
Sun Oct 26 00:37:00 GMT 2008


2008/10/25 Manuel López-Ibáñez <lopezibanez@gmail.com>:
> 2008/10/23 Richard Guenther <richard.guenther@gmail.com>:
>> On Thu, Oct 23, 2008 at 2:57 AM, Manuel López-Ibáñez
>> <lopezibanez@gmail.com> wrote:
>>> Now with patch.
>>>
>>> 2008/10/23 Manuel López-Ibáñez <lopezibanez@gmail.com>:
>>>> This is similar case as my patch for PR 31246: more cases of
>>>> compiler-generated code. In fact, there is some overlap between them.
>>>>
>>>> Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
>>>> --enable-languages=all,obj-c++ --enable-decimal-float.
>>>>
>>>> OK for trunk?
>>
>> Wherever you just set TREE_NO_WARNING or gimple_set_no_warning
>> (and not propagate it) during gimplification looks fishy.
>>
>> It looks like for both patches it might work to just disable these warnings for
>> EH related code?  (The propagation of the no-warning flag during gimplification
>> _does_ look correct, though)
>>

The previous patch didn't make sense because the try/finally was
created during gimplification and nothing marked it as no_warning, so
propagating cannot be enough. I rechecked it and I must have mixed up
the results. The artificial try/finally created during gimplification
does need to be marked as no_warning to avoid warning.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu with
--enable-languages=all,obj-c++ --enable-decimal-float.

2008-10-23  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/36254
	* gimplify.c (gimplify_expr): Propagate the no_warning flag.
	* gimple-low.c (lower_function_body): Propagate the no_warning
	flag.
cp/
	* cp-gimplify (cp_genericize_r): Set no_warning flag for
	artificial try/catch and try/finally.
testsuite/	
	* g++dg/eh/pr36254.C: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-pr36254-try2.diff
Type: text/x-diff
Size: 3052 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081026/13c9848b/attachment.bin>


More information about the Gcc-patches mailing list