summaryrefslogtreecommitdiff
path: root/gcc/c-semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-semantics.c')
-rw-r--r--gcc/c-semantics.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index 35cb559e6f8..a4d11f8e606 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -447,8 +447,9 @@ genrtl_do_stmt (t)
/* Recognize the common special-case of do { ... } while (0) and do
not emit the loop widgetry in this case. In particular this
avoids cluttering the rtl with dummy loop notes, which can affect
- alignment of adjacent labels. */
- if (integer_zerop (cond))
+ alignment of adjacent labels. COND can be NULL due to parse
+ errors. */
+ if (!cond || integer_zerop (cond))
{
expand_start_null_loop ();
expand_stmt (DO_BODY (t));