Bug ID: 84823
           Summary: [6 Regression?] x86 LRA hang on valid code (no ICE)
                    with -fno-omit-frame-pointer
           Product: gcc
           Version: 6.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot
          Reporter: awilfox at adelielinux dot org
  Target Milestone: ---

Created attachment 43626
preprocessed source that fails

Adélie Linux 1.0-alpha5
Intel(R) Pentium(R) 4 CPU 2.40GHz [15/2/9; HT enabled]
gcc (Adelie 6.4.0) 6.4.0
musl libc 1.1.19

Compiling WINE 3.0 for the x86 architecture of Adélie on our builder.  Target
arch is Pentium MMX.

Actual result:
cc1 hung for almost 16 hours while compiling ntdll/server.c.  Trying again with
-fchecking -Q made no difference; three hours later, no ICE was generated. 
Output was:

 __FLOAT_BITS __DOUBLE_BITS __islessf __isless __islessl __islessequalf
__islessequal __islessequall __islessgreaterf __islessgreater __islessgreaterl
__isgreaterf __isgreater __isgreaterl __isgreaterequalf __isgreaterequal
__isgreaterequall __bswap16 __bswap32 __bswap64 __fortify_FD_CLR
__fortify_FD_SET bcopy bzero memcpy memmove memset stpcpy stpncpy strcat strcpy
strncat strncpy mempcpy strlcat strlcpy realpath confstr getcwd getdomainname
getgroups gethostname getlogin_r pread read readlink readlinkat ttyname_r write
memcpy_unaligned interlocked_cmpxchg interlocked_cmpxchg_ptr interlocked_xchg
interlocked_xchg_ptr interlocked_xchg_add interlocked_cmpxchg64 __isspace fgets
fread fwrite vsnprintf vsprintf snprintf sprintf recv recvfrom send sendto
NtCurrentTeb RtlSecureZeroMemory HRESULT_FROM_WIN32 lstrcpynW lstrcpynA
lstrlenW lstrlenA lstrcpyW lstrcpyA lstrcatW lstrcatA
InterlockedCompareExchangePointer InterlockedExchangePointer GetLastError
GetCurrentProcessId GetCurrentThreadId SetLastError GetProcessHeap
wine_ldt_set_base wine_ldt_set_limit wine_ldt_get_base wine_ldt_get_limit
wine_ldt_set_flags wine_ldt_get_flags wine_ldt_is_empty wine_get_cs wine_get_ds
wine_get_es wine_get_fs wine_get_gs wine_get_ss wine_set_fs wine_set_gs
DbgBreakPoint DbgUserBreakPoint RtlCheckBit RtlUshortByteSwap RtlUlongByteSwap
RemoveHeadList RemoveTailList get_vm86_teb_info wine_server_call_err
wine_server_reply_size wine_server_add_data wine_server_set_reply
wine_server_obj_handle wine_server_user_handle wine_server_ptr_handle
wine_server_client_ptr wine_server_get_ptr wine_dbgstr_a wine_dbgstr_w
wine_dbgstr_guid wine_dbgstr_point wine_dbgstr_rect wine_dbgstr_longlong
debugstr_an debugstr_wn debugstr_guid debugstr_a debugstr_w __CPU_AND_S
__CPU_OR_S __CPU_XOR_S ntdll_get_thread_data interlocked_xchg64 fatal_error
fatal_perror server_protocol_error server_protocol_perror send_request
read_reply_data wait_reply server_call_unlocked wine_server_call
server_enter_uninterrupted_section server_leave_uninterrupted_section
wait_select_reply invoke_apc server_select server_queue_process_apc
wine_server_send_fd receive_fd handle_to_index add_fd_to_cache get_cached_fd
server_remove_fd_from_cache server_get_unix_fd wine_server_fd_to_handle
wine_server_handle_to_fd wine_server_release_fd server_pipe start_server
setup_config_dir server_connect_error server_connect get_unix_tid
server_init_process server_init_process_done server_init_thread
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <build_ssa_passes> <opt_local_passes>
<targetclone> <free-inline-summary> <whole-program> <profile_estimate> <icf>
<devirt> <cp> <inline> <pure-const> <static-var> <single-use>
<comdats>Assembling functions:
 <simdclone> server_protocol_error server_protocol_perror read_reply_data
wait_select_reply invoke_apc receive_fd add_fd_to_cache fatal_perror
fatal_error start_server server_connect server_call_unlocked wine_server_call
server_enter_uninterrupted_section server_leave_uninterrupted_section
server_select server_queue_process_apc wine_server_send_fd
server_remove_fd_from_cache server_get_unix_fd

Expected result:
Compilation of ntdll/server.c translation unit.

CFLAGS in use at the time (incl. WINE package defaults and Adélie overrides):

gcc -c -o server.o server.c -I. -I../../include -D__WINESRC__ -D_NTSYSTEM_
-D_REENTRANT -fPIC -Wall   -pipe -fno-strict-aliasing
-Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers  
-Wn-packed-not-aligned -Wshift-overflow=2 -Wstrict-prototypes -Wtype-limits  
-Wunused-but-set-parameter -Wvla -Wwrite-strings -Wpointer-arith -Wlogical-op
-gdwarf-2   -gstrict-dwarf -fno-omit-frame-pointer -O2 -march=pentium-mmx
-mtune=pentium-m -fno-omit-frame-pointer -g -U_FORTIFY_SOURCE

If -fno-omit-frame-pointer is removed, compilation succeeds.  If -O2 is
replaced with -O0, compilation succeeds.  It feels like a rehash of 55396 but
that was solved back in the 4.x days.  I will note that when we built WINE 2.x
last year with GCC 5.3.0 this issue did not occur, and -fno-omit-frame-pointer
was active then; hence, this may be a regression in 6.  (The WINE code doesn't
appear to have been touched since 2016.)  However, I do not know if LRA was on
by default on x86 in the 5.x series.

Attached is the .i from a run that failed.

Reply via email to