This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gomp4, PR68977, Committed] Don't gimplify in ssa mode if seen_error in oacc_xform_loop


On Mon, Jan 25, 2016 at 12:00 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 14/01/16 10:43, Richard Biener wrote:
>>
>> On Wed, Jan 13, 2016 at 9:04 PM, Tom de Vries <Tom_deVries@mentor.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> At r231739, there was an ICE when checking code generated by
>>> oacc_xform_loop, in case the source contained an error.
>>>
>>> Due to seen_error (), gimplification during oacc_xform_loop bailed out,
>>> and
>>> an uninitialized var was introduced.  Because of gimplifying in ssa mode,
>>> that caused an ICE.
>>>
>>> I can't reproduce this any longer, but I think the fix still makes sense.
>>> The patch makes sure oacc_xform_loop gimplifies in non-ssa mode if
>>> seen_error ().
>>
>>
>> I don't think it makes "sense" in any way.  After seen_error () a
>> following ICE
>> will be "confused after earlier errors" in release mode and thus I think
>> that's
>> not an important problem to paper over with this kind of "hack".
>>
>> I'd rather avoid doing any of omp-low if seen_error ()?
>>
>
> The error triggered in oacc_device_lower, so there's nothing we can do
> before (in omp-low).
>
> How about this fix, which replaces the oacc ifn calls with zero-assignments
> if seen_error ()?

Again it looks like too much complexity for an ICE-after-error which will
be reported as "confused after errors" only.  I'd accept a patch that simply
stops processing the function before lowering which is what we usually
do with this kind of cases [yes, it might make sense to start tracking
seen-error per function].

So in this case add a seen_errors () guard to cgraph_node::expand ()
like the following:

Index: cgraphunit.c
===================================================================
--- cgraphunit.c        (revision 232666)
+++ cgraphunit.c        (working copy)
@@ -1967,15 +1967,18 @@ cgraph_node::expand (void)

   execute_all_ipa_transforms ();

-  /* Perform all tree transforms and optimizations.  */
-
-  /* Signal the start of passes.  */
-  invoke_plugin_callbacks (PLUGIN_ALL_PASSES_START, NULL);
-
-  execute_pass_list (cfun, g->get_passes ()->all_passes);
-
-  /* Signal the end of passes.  */
-  invoke_plugin_callbacks (PLUGIN_ALL_PASSES_END, NULL);
+  if (! seen_error ())
+    {
+      /* Perform all tree transforms and optimizations.  */
+
+      /* Signal the start of passes.  */
+      invoke_plugin_callbacks (PLUGIN_ALL_PASSES_START, NULL);
+
+      execute_pass_list (cfun, g->get_passes ()->all_passes);
+
+      /* Signal the end of passes.  */
+      invoke_plugin_callbacks (PLUGIN_ALL_PASSES_END, NULL);
+    }

   bitmap_obstack_release (&reg_obstack);

Richard.

> Thanks,
> - Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]