Skip to content

Commit 0a65990

Browse files
committed
Workaround an ICE in gcc 4.x
1 parent 5f0a5ec commit 0a65990

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

posix/regex.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ __typeof__(regexec) __regexec;
150150
__typeof__(regerror) __regerror;
151151
__typeof__(regfree) __regfree;
152152

153+
#if defined(__OPTIMIZE__) && __OPTIMIZE__ == 1 && __GNUC__ <= 4
154+
/* gcc 4.x gets ICE when compiling this with -O1 */
155+
#pragma GCC optimize "-O2"
156+
#endif
153157

154158
#ifdef __MINT__
155159
extern int __re_search_2

0 commit comments

Comments
 (0)