This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 867878 - s390 build fails with Error: Unrecognized opcode: `srak'
s390 build fails with Error: Unrecognized opcode: `srak'
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gcc (Show other bugs)
s390x Linux
urgent Severity urgent
: rc
: ---
Assigned To: Jakub Jelinek
: Regression
Depends On:
  Show dependency treegraph
Reported: 2012-10-18 09:34 EDT by Martin Stransky
Modified: 2013-02-21 05:26 EST (History)
3 users (show)

See Also:
Fixed In Version: gcc-4.4.7-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-21 05:26:59 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:

Attachments (Terms of Use)
preprocessed c source of (213.12 KB, text/x-c++src)
2012-10-18 09:34 EDT, Martin Stransky
no flags Details

  None (edit)
Description Martin Stransky 2012-10-18 09:34:49 EDT
Created attachment 629381 [details]
preprocessed c source of

Description of problem:

When building firefox in brew, gcc fails with Error: Unrecognized opcode: `srak'. The same package builds on stable systems. Affects both s390 and s390x.

Complete build log:

Gcc command:
c++ -o hb-ot-shape-fallback.o -c -I../../../dist/stl_wrappers -I../../../dist/system_wrappers -include /builddir/build/BUILD/xulrunner-17.0/mozilla-beta/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DPACKAGE_VERSION="\"moz\"" -DPACKAGE_BUGREPORT="\"\"" -DHAVE_OT=1 -DHB_NO_MT -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/gfx/harfbuzz/src  -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/gfx/harfbuzz/src -I. -I../../../dist/include  -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/objdir/dist/include/nspr -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/objdir/dist/include/nss      -fPIC  -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -fstack-protector --param=ssp-buffer-size=4 -m31 -march=z9-109 -mtune=z10 -fpermissive -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer   -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MF .deps/hb-ot-shape-fallback.o.pp -UDEBUG /builddir/build/BUILD/xulrunner-17.0/mozilla-beta/gfx/harfbuzz/src/
{standard input}: Assembler messages:
{standard input}:131: Error: Unrecognized opcode: `srak'

Version-Release number of selected component (if applicable):

gcc                    s390    4.4.6-4.el6
binutils               s390
Comment 1 Martin Stransky 2012-10-18 09:38:07 EDT
s390x failure:

Build log:

Root log:

gcc command:
c++ -o hb-ot-shape-fallback.o -c -I../../../dist/stl_wrappers -I../../../dist/system_wrappers -include /builddir/build/BUILD/xulrunner-17.0/mozilla-beta/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DPACKAGE_VERSION="\"moz\"" -DPACKAGE_BUGREPORT="\"\"" -DHAVE_OT=1 -DHB_NO_MT -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/gfx/harfbuzz/src  -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/gfx/harfbuzz/src -I. -I../../../dist/include  -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/objdir/dist/include/nspr -I/builddir/build/BUILD/xulrunner-17.0/mozilla-beta/objdir/dist/include/nss      -fPIC  -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wcast-align -Wno-long-long -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fno-exceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -march=z9-109 -mtune=z10 -fpermissive -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer   -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MF .deps/hb-ot-shape-fallback.o.pp -UDEBUG /builddir/build/BUILD/xulrunner-17.0/mozilla-beta/gfx/harfbuzz/src/
{standard input}: Assembler messages:
{standard input}:134: Error: Unrecognized opcode: `srak'

gcc                    s390x   4.4.6-4.el6
binutils               s390x
Comment 2 Martin Stransky 2012-10-18 09:40:35 EDT
Note: build fine on stable systems with:

Comment 6 Martin Stransky 2012-10-18 10:47:44 EDT
Is there any workaround for that? It blocks upcoming Firefox update.
Comment 7 Jakub Jelinek 2012-10-18 10:51:04 EDT
Regression from RHEL 6.0 caused by #633375.
Comment 9 Jakub Jelinek 2012-10-18 11:22:31 EDT
As workaround I guess
 static inline void
 position_cluster (const hb_ot_shape_plan_t *plan,
 		  hb_font_t *font,
 		  hb_buffer_t  *buffer,
 		  unsigned int start,
 		  unsigned int end)
+#ifdef __s390__
+  hb_unicode_general_category_t category;
   if (end - start < 2)
   /* Find the base glyph */
   for (unsigned int i = start; i < end; i++)
     if (is_a_ligature (buffer->info[i]) ||
+#ifdef __s390__
+	((category = _hb_glyph_info_get_general_category (&buffer->info[i]))
         !(FLAG (_hb_glyph_info_get_general_category (&buffer->info[i])) &
       position_around_base (plan, font, buffer, i, end);

(completely untested) might do the trick, that way there will be no right shift
with shift count which is bitwise and.  Or store result of
 _hb_glyph_info_get_general_category into a temporary and do
  __asm ("" : "+r" (category)); on it before doing the FLAG test to prevent gcc from optimizing it.
So basically change the:
         !(FLAG (_hb_glyph_info_get_general_category (&buffer->info[i])) &
line to:
         !(FLAG (({ hb_unicode_general_category_t category = _hb_glyph_info_get_general_category (&buffer->info[i]); __asm ("" : "+g" (category)); category; })) &
Comment 12 Jakub Jelinek 2012-10-19 04:40:55 EDT
Short testcase:
int bar (char);

foo (char *x, unsigned int y)
  unsigned int i;
  for (i = 0; i < y; i++)
    if (bar (x[i]) || ((1 << (x[i] & 0x7f)) & 0x2314))
gcc -c -O2 -march=z9-109 test.c
should assemble without errors with gcc-4.4.7-3.el6, should fail with gcc-4.4.7-2.el6.  With -march=z196 it should succeed with both.
Comment 13 Martin Stransky 2012-10-26 05:27:16 EDT
The workaround works, thanks!
Comment 16 errata-xmlrpc 2013-02-21 05:26:59 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

Note You need to log in before you can comment on or make changes to this bug.