public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
@ 2015-01-28 11:50 glaubitz at physik dot fu-berlin.de
  2015-02-15 21:29 ` [Bug c/64833] " olegendo at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-01-28 11:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

            Bug ID: 64833
           Summary: [SH]: Error: pcrel too far when compiling imagemagick
                    and graphicsmagick on Debian sh4
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glaubitz at physik dot fu-berlin.de

Hello!

Both imagemagick and graphicsmagick currently fail to build from source on
Debian sh4 with the current version of gcc, 4.9.2.

Both packages used to build fine with gcc-4.6, so I assume it's a regression in
gcc-4.8/4.9.

imagemagick [1]:

/usr/bin/perl /usr/share/perl/5.20.1/ExtUtils/xsubpp  -typemap
/usr/share/perl/5.20/ExtUtils/typemap -typemap typemap Q16.xs > Q16.xsc && mv
Q16.xsc Q16.c
gcc -std=gnu99 -std=gnu99 -c  -I../ -I../../../.. -D_FORTIFY_SOURCE=2
-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/X11
-I/usr/include/libxml2 -I"/usr/include/ImageMagick" -D_REENTRANT -D_GNU_SOURCE
-DDEBIAN -mieee -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/lqr-1
-I/usr/include/glib-2.0 -I/usr/lib/sh4-linux-gnu/glib-2.0/include
-I/usr/include/freetype2 -fopenmp -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wall -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0
-DMAGICKCORE_QUANTUM_DEPTH=16 -O2 -g   -DVERSION=\"6.89\" -DXS_VERSION=\"6.89\"
-fPIC "-I/usr/lib/sh4-linux-gnu/perl/5.20/CORE"  -D_FILE_OFFSET_BITS=64
-D_LARGE_FILES=1 -DHAVE_CONFIG_H Q16.c
{standard input}: Assembler messages:
{standard input}:5204: Error: pcrel too far
make[4]: *** [Q16.o] Error 1

graphicsmagick [2]:

In file included from Magick.xs:58:0:
/usr/lib/sh4-linux-gnu/perl/5.20/CORE/XSUB.h:183:20: warning: unused variable
'ix' [-Wunused-variable]
 #define dXSI32 I32 ix = XSANY.any_i32
                    ^
Magick.c:7874:5: note: in expansion of macro 'dXSI32'
     dXSI32;
     ^
Magick.c: At top level:
Magick.xs:247:4: warning: 'LogEventTypes' defined but not used
[-Wunused-variable]
   *LogEventTypes[] =
    ^
{standard input}: Assembler messages:
{standard input}:15081: Error: pcrel too far
{standard input}:15082: Error: pcrel too far
make[2]: *** [Magick.o] Error 1
Makefile:348: recipe for target 'Magick.o' failed

Cheers,
Adrian

> [1] http://buildd.debian-ports.org/status/fetch.php?pkg=imagemagick&arch=sh4&ver=8%3A6.8.9.9-5&stamp=1422394497
> [2] http://buildd.debian-ports.org/status/fetch.php?pkg=graphicsmagick&arch=sh4&ver=1.3.20-3&stamp=1417619120


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug c/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
@ 2015-02-15 21:29 ` olegendo at gcc dot gnu.org
  2015-02-15 22:12 ` [Bug target/64833] " olegendo at gcc dot gnu.org
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-15 21:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |sh*-*-*
                 CC|                            |kkojima at gcc dot gnu.org,
                   |                            |olegendo at gcc dot gnu.org

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Thanks for reporting this.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
  2015-02-15 21:29 ` [Bug c/64833] " olegendo at gcc dot gnu.org
@ 2015-02-15 22:12 ` olegendo at gcc dot gnu.org
  2015-02-15 22:44 ` glaubitz at physik dot fu-berlin.de
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-15 22:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Would it be possible for you to pull a precompiled source from the build via
the '-save-temps' option?


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
  2015-02-15 21:29 ` [Bug c/64833] " olegendo at gcc dot gnu.org
  2015-02-15 22:12 ` [Bug target/64833] " olegendo at gcc dot gnu.org
@ 2015-02-15 22:44 ` glaubitz at physik dot fu-berlin.de
  2015-02-25 20:12 ` olegendo at gcc dot gnu.org
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-02-15 22:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #3 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
Hi Oleg!

Yes, I will simply run a manual build in the following days and just make sure
nothing is thrown away. I finally have my very own SH4 board now and I will set
it up in the upcoming week. Then I can do all sorts of tests without having to
mess with the buildds.

I will report back once I have something that can be debugged.

Adrian


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (2 preceding siblings ...)
  2015-02-15 22:44 ` glaubitz at physik dot fu-berlin.de
@ 2015-02-25 20:12 ` olegendo at gcc dot gnu.org
  2015-02-25 20:33 ` glaubitz at physik dot fu-berlin.de
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-25 20:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Ping.  Precompiled source to reproduce the problem is still missing here.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (3 preceding siblings ...)
  2015-02-25 20:12 ` olegendo at gcc dot gnu.org
@ 2015-02-25 20:33 ` glaubitz at physik dot fu-berlin.de
  2015-03-15 11:44 ` glaubitz at physik dot fu-berlin.de
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-02-25 20:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #5 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Oleg Endo from comment #4)
> Ping.  Precompiled source to reproduce the problem is still missing here.

I will try to provide it in the following days. For both imagemagick and
graphicsmagick, there was no intermediate source file dumped into /tmp so I
have to start a manual build.

Thanks for the heads up, I will get the required files.

Adrian


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (4 preceding siblings ...)
  2015-02-25 20:33 ` glaubitz at physik dot fu-berlin.de
@ 2015-03-15 11:44 ` glaubitz at physik dot fu-berlin.de
  2015-06-28 13:18 ` olegendo at gcc dot gnu.org
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-03-15 11:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #6 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
Here's a tarball with the failed build:

> http://userpage.physik.fu-berlin.de/~glaubitz/graphicsmagick-failed-build.tar.gz

You can reproduce the problem with:

$ cd graphicsmagick-1.3.20/
$ cd PerlMagick/
$ make Magick.o

You probably need a working Perl installation to be able to build.

Adrian


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (5 preceding siblings ...)
  2015-03-15 11:44 ` glaubitz at physik dot fu-berlin.de
@ 2015-06-28 13:18 ` olegendo at gcc dot gnu.org
  2015-06-28 15:16 ` glaubitz at physik dot fu-berlin.de
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-06-28 13:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Is there any update regarding this issue?  Adrian, were you able to get a
preprocessed source file which reproduces the problem?


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (6 preceding siblings ...)
  2015-06-28 13:18 ` olegendo at gcc dot gnu.org
@ 2015-06-28 15:16 ` glaubitz at physik dot fu-berlin.de
  2015-06-28 15:24 ` glaubitz at physik dot fu-berlin.de
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-06-28 15:16 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 13636 bytes --]

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #8 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
Alright, know that I understand how to create pre-processed sources manually,
I'm attaching the requested pre-processed sources.

Here's how I obtained the pre-processed source. From my point of view, it
either seems to work now with the current version of gcc in Debian sh4 or I
need to do something else to be able to reproduce it:

glaubitz@tirpitz:~/debian/graphicsmagick-1.3.20/PerlMagick$ gcc -E Magick.c -o
Magick.i -I/usr/lib/sh4-linux-gnu/perl/5.20.2/CORE/ -I..
glaubitz@tirpitz:~/debian/graphicsmagick-1.3.20/PerlMagick$ ls
blib               demo       Magick.i      Magick.xs    Makefile.nt         
Makefile.PL.in  MYMETA.json         PerlMagickCheck.sh.in  t
build_manifest.sh  Magick.bs  Magick.pm     Makefile     Makefile.PL         
MANIFEST        MYMETA.yml          pm_to_blib             typemap
Changelog          Magick.c   Magick.pm.in  Makefile.am  Makefile.PL.debsave 
MANIFEST.SKIP   PerlMagickCheck.sh  README.txt
glaubitz@tirpitz:~/debian/graphicsmagick-1.3.20/PerlMagick$
/usr/lib/gcc/sh4-linux-gnu/4.9/cc1 Magick.i 
 __bswap_32 __bswap_64 set_regex_charset get_regex_charset
get_regex_charset_name S_CvGV CvNAME_HEK S_perl_hash_siphash_2_4
S_perl_hash_superfast S_perl_hash_murmur3 S_perl_hash_djb2 S_perl_hash_sdbm
S_perl_hash_one_at_a_time S_perl_hash_one_at_a_time_hard
S_perl_hash_old_one_at_a_time S_av_top_index S_CvDEPTHp S_ReANY S_SvREFCNT_inc
S_SvREFCNT_inc_NN S_SvREFCNT_inc_void S_SvREFCNT_dec S_SvREFCNT_dec_NN
SvAMAGIC_on SvAMAGIC_off S_SvPADTMP_on S_SvPADTMP_off S_SvPADSTALE_on
S_SvPADSTALE_off S_croak_memory_wrap S_append_utf8_from_native_byte
S_isIDFIRST_lazy S_isALNUM_lazy S_is_safe_syscall MagickRandomIntegerInlined
MagickRandomRealInlined ClonePackageInfo constant DestroyPackageInfo GetList
Magick.xs: In function ‘GetList’:
Magick.xs:831:13: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
       image=(Image *) SvIV(reference);
             ^
 GetPackageInfo
Magick.xs: In function ‘GetPackageInfo’:
Magick.xs:901:4: error: ‘XS_VERSION’ undeclared (first use in this function)
    XS_VERSION);
    ^
Magick.xs:901:4: note: each undeclared identifier is reported only once for
each function it appears in
Magick.xs:910:52: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
   if (SvIOKp(sv) && (clone_info=(struct PackageInfo *) SvIV(sv)))
                                                    ^
Magick.xs:913:29: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
   sv_setiv(sv,(IV) clone_info);
                             ^
 LookupStr MagickErrorHandler MagickWarningHandler SetAttribute SetupList
strEQcase XS_Graphics__Magick_constant XS_Graphics__Magick_Animate
XS_Graphics__Magick_Append
Magick.xs: In function ‘XS_Graphics__Magick_Append’:
Magick.xs:2278:32: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
       sv=newSViv((IV) image);
                                ^
 XS_Graphics__Magick_Average
Magick.xs: In function ‘XS_Graphics__Magick_Average’:
Magick.xs:2380:30: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
     sv=newSViv((IV) image);
                              ^
 XS_Graphics__Magick_BlobToImage
Magick.xs: In function ‘XS_Graphics__Magick_BlobToImage’:
Magick.xs:2515:34: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
         sv=newSViv((IV) image);
                                  ^
 XS_Graphics__Magick_Coalesce
Magick.xs: In function ‘XS_Graphics__Magick_Coalesce’:
Magick.xs:2624:32: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
       sv=newSViv((IV) image);
                                ^
 XS_Graphics__Magick_Copy
Magick.xs: In function ‘XS_Graphics__Magick_Copy’:
Magick.xs:2728:32: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
       sv=newSViv((IV) clone);
                                ^
 XS_Graphics__Magick_DESTROY
Magick.xs: In function ‘XS_Graphics__Magick_DESTROY’:
Magick.xs:2788:11: error: ‘XS_VERSION’ undeclared (first use in this function)
           XS_VERSION);
           ^
Magick.xs:2793:23: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
                 (info=(struct PackageInfo *) SvIV(sv)))
                       ^
Magick.xs:2809:15: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
         image=(Image *) SvIV(reference);
               ^
 XS_Graphics__Magick_Display XS_Graphics__Magick_Flatten
Magick.xs: In function ‘XS_Graphics__Magick_Flatten’:
Magick.xs:2988:30: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
     sv=newSViv((IV) image);
                              ^
 XS_Graphics__Magick_Get
Magick.xs: In function ‘XS_Graphics__Magick_Get’:
Magick.xs:3211:44: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
                   sv=newSViv((IV) image->clip_mask);
                                            ^
 XS_Graphics__Magick_ImageToBlob XS_Graphics__Magick_Mogrify
Magick.xs: In function ‘XS_Graphics__Magick_Mogrify’:
Magick.xs:6061:38: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
           sv_setiv(*pv,(IV) image);
                                      ^
 XS_Graphics__Magick_Montage
Magick.xs: In function ‘XS_Graphics__Magick_Montage’:
Magick.xs:6446:32: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
       sv=newSViv((IV) image);
                                ^
 XS_Graphics__Magick_Morph
Magick.xs: In function ‘XS_Graphics__Magick_Morph’:
Magick.xs:6583:32: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
       sv=newSViv((IV) image);
                                ^
 XS_Graphics__Magick_Mosaic
Magick.xs: In function ‘XS_Graphics__Magick_Mosaic’:
Magick.xs:6681:30: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
     sv=newSViv((IV) image);
                              ^
 XS_Graphics__Magick_Ping XS_Graphics__Magick_QueryColor
XS_Graphics__Magick_QueryColorname XS_Graphics__Magick_QueryFont
XS_Graphics__Magick_QueryFontMetrics XS_Graphics__Magick_QueryFormat
XS_Graphics__Magick_Read
Magick.xs: In function ‘XS_Graphics__Magick_Read’:
Magick.xs:7608:34: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
         sv=newSViv((IV) image);
                                  ^
 XS_Graphics__Magick_Remote XS_Graphics__Magick_Set
XS_Graphics__Magick_Transform
Magick.xs: In function ‘XS_Graphics__Magick_Transform’:
Magick.xs:7884:34: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
         sv=newSViv((IV) clone);
                                  ^
 XS_Graphics__Magick_Write boot_Graphics__Magick
Analyzing compilation unit

Execution times (seconds)
 phase setup             :   0.15 ( 1%) usr   0.01 ( 0%) sys   0.34 ( 1%) wall 
   520 kB ( 5%) ggc
 phase parsing           :  10.74 (79%) usr   3.42 (97%) sys  24.80 (88%) wall 
  6497 kB (57%) ggc
 phase lang. deferred    :   0.01 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 phase opt and generate  :   2.64 (19%) usr   0.08 ( 2%) sys   3.01 (11%) wall 
  4339 kB (38%) ggc
 phase finalize          :   0.00 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 callgraph construction  :   0.18 ( 1%) usr   0.00 ( 0%) sys   0.26 ( 1%) wall 
   564 kB ( 5%) ggc
 preprocessing           :   3.06 (23%) usr   0.90 (26%) sys   6.66 (24%) wall 
  1043 kB ( 9%) ggc
 lexical analysis        :   0.97 ( 7%) usr   1.56 (44%) sys   4.68 (17%) wall 
     0 kB ( 0%) ggc
 parser (global)         :   2.81 (21%) usr   0.51 (14%) sys   6.91 (24%) wall 
  3248 kB (29%) ggc
 parser struct body      :   0.38 ( 3%) usr   0.03 ( 1%) sys   0.95 ( 3%) wall 
   334 kB ( 3%) ggc
 parser enumerator list  :   0.22 ( 2%) usr   0.02 ( 1%) sys   0.44 ( 2%) wall 
   255 kB ( 2%) ggc
 parser function body    :   3.04 (22%) usr   0.33 ( 9%) sys   4.41 (16%) wall 
  1505 kB (13%) ggc
 parser inl. func. body  :   0.24 ( 2%) usr   0.04 ( 1%) sys   0.65 ( 2%) wall 
   107 kB ( 1%) ggc
 tree gimplify           :   2.00 (15%) usr   0.06 ( 2%) sys   2.31 ( 8%) wall 
  2734 kB (24%) ggc
 tree eh                 :   0.07 ( 1%) usr   0.00 ( 0%) sys   0.05 ( 0%) wall 
    27 kB ( 0%) ggc
 tree CFG construction   :   0.24 ( 2%) usr   0.00 ( 0%) sys   0.30 ( 1%) wall 
   989 kB ( 9%) ggc
 tree CFG cleanup        :   0.10 ( 1%) usr   0.00 ( 0%) sys   0.06 ( 0%) wall 
     0 kB ( 0%) ggc
 dominance computation   :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 varconst                :   0.02 ( 0%) usr   0.02 ( 1%) sys   0.09 ( 0%) wall 
     1 kB ( 0%) ggc
 loop init               :   0.02 ( 0%) usr   0.00 ( 0%) sys   0.02 ( 0%) wall 
    22 kB ( 0%) ggc
 symout                  :   0.00 ( 0%) usr   0.01 ( 0%) sys   0.01 ( 0%) wall 
     0 kB ( 0%) ggc
 unaccounted todo        :   0.01 ( 0%) usr   0.02 ( 1%) sys   0.00 ( 0%) wall 
     0 kB ( 0%) ggc
 TOTAL                 :  13.55             3.52            28.21             
11365 kB
glaubitz@tirpitz:~/debian/graphicsmagick-1.3.20/PerlMagick$ ls -l
total 1588
drwxr-xr-x  8 glaubitz glaubitz   4096 Mar 14  2015 blib
-rwxr-xr-x  1 glaubitz glaubitz    182 Mar 10  2013 build_manifest.sh
-rw-r--r--  1 glaubitz glaubitz   4605 Mar 10  2013 Changelog
drwxr-xr-x  2 glaubitz glaubitz   4096 Mar 10  2013 demo
-rw-r--r--  1 glaubitz glaubitz      0 Mar 14  2015 Magick.bs
-rw-r--r--  1 glaubitz glaubitz 270942 Mar 14  2015 Magick.c
-rw-r--r--  1 glaubitz glaubitz 944997 Jan  1 01:19 Magick.i
-rw-r--r--  1 glaubitz glaubitz   3648 Mar 14  2015 Magick.pm
-rw-r--r--  1 glaubitz glaubitz   3659 Mar 10  2013 Magick.pm.in
-rw-r--r--  1 glaubitz glaubitz     34 Jan  1 01:20 Magick.s
-rw-r--r--  1 glaubitz glaubitz 248880 Aug 16  2014 Magick.xs
-rw-r--r--  1 glaubitz glaubitz  34387 Mar 14  2015 Makefile
-rw-r--r--  1 glaubitz glaubitz   4169 Mar 10  2013 Makefile.am
-rw-r--r--  1 glaubitz glaubitz   6152 Mar 10  2013 Makefile.nt
-rw-r--r--  1 glaubitz glaubitz   4451 Mar 14  2015 Makefile.PL
-rw-r--r--  1 glaubitz glaubitz   4410 Mar 14  2015 Makefile.PL.debsave
-rw-r--r--  1 glaubitz glaubitz   4049 Mar 10  2013 Makefile.PL.in
-rw-r--r--  1 glaubitz glaubitz  11216 Mar 10  2013 MANIFEST
-rw-r--r--  1 glaubitz glaubitz    207 Mar 10  2013 MANIFEST.SKIP
-rw-r--r--  1 glaubitz glaubitz    831 Mar 14  2015 MYMETA.json
-rw-r--r--  1 glaubitz glaubitz    479 Mar 14  2015 MYMETA.yml
-rwxr-xr-x  1 glaubitz glaubitz   1234 Mar 14  2015 PerlMagickCheck.sh
-rwxr-xr-x  1 glaubitz glaubitz   1214 Mar 10  2013 PerlMagickCheck.sh.in
-rw-r--r--  1 glaubitz glaubitz      0 Mar 14  2015 pm_to_blib
-rw-r--r--  1 glaubitz glaubitz   4807 Mar 10  2013 README.txt
drwxr-xr-x 22 glaubitz glaubitz   4096 Aug 16  2014 t
-rw-r--r--  1 glaubitz glaubitz     26 Mar 10  2013 typemap
glaubitz@tirpitz:~/debian/graphicsmagick-1.3.20/PerlMagick$

See attachments.
>From gcc-bugs-return-490936-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jun 28 15:17:41 2015
Return-Path: <gcc-bugs-return-490936-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 56966 invoked by alias); 28 Jun 2015 15:17:41 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 48678 invoked by uid 48); 28 Jun 2015 15:17:37 -0000
From: "glaubitz at physik dot fu-berlin.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
Date: Sun, 28 Jun 2015 15:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glaubitz at physik dot fu-berlin.de
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-64833-4-OOWGSAFzee@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64833-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64833-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg03268.txt.bz2
Content-length: 267

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd833

--- Comment #9 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
Created attachment 35870
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id5870&actioníit
Pre-processed source Magick.i


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (7 preceding siblings ...)
  2015-06-28 15:16 ` glaubitz at physik dot fu-berlin.de
@ 2015-06-28 15:24 ` glaubitz at physik dot fu-berlin.de
  2015-06-29  5:07 ` olegendo at gcc dot gnu.org
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-06-28 15:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #10 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
Created attachment 35871
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35871&action=edit
Source file Magick.c


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (8 preceding siblings ...)
  2015-06-28 15:24 ` glaubitz at physik dot fu-berlin.de
@ 2015-06-29  5:07 ` olegendo at gcc dot gnu.org
  2015-06-29  5:45 ` kkojima at gcc dot gnu.org
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-06-29  5:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #11 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to John Paul Adrian Glaubitz from comment #9)
> Created attachment 35870 [details]
> Pre-processed source Magick.i

I've tried compiling that file with '-x c -std=gnu99 -O2 -g -fPIC -m4
-DXS_VERSION=\"6.89\"' with 4.9, 5.1 and trunk sh-elf cross compilers.  None of
them seems to trigger the issue.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (9 preceding siblings ...)
  2015-06-29  5:07 ` olegendo at gcc dot gnu.org
@ 2015-06-29  5:45 ` kkojima at gcc dot gnu.org
  2015-06-29  8:52 ` glaubitz at physik dot fu-berlin.de
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-06-29  5:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #12 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
I could reproduce the problem on trunk with '-DXS_VERSION=\"6.89\" -fwrapv
-fno-strict-aliasing -fopenmp -O2 -fstack-protector-strong -fexceptions -fPIC'
with the cross sh4-unknown-linux-gnu compiler.

It seems that get_attr_length returns 4 instead of 8 which is the correct
length for casesi_worker_2 in find_barrier function for the problematic
situation.  In that case, the casesi_worker_1 insn of which length is 4,
was transformed to casesi_worker_2 and get_attr_length returns the cached
old value which is the length for the original casesi_worker_1.
It looks to be latent in the older compilers, though the PR is a 4.9/5/6
regression formally.
Here is a possible fix:

diff --git a/config/sh/sh.c b/config/sh/sh.c
index 0139095..86cbea7 100644
--- a/config/sh/sh.c
+++ b/config/sh/sh.c
@@ -5261,6 +5261,11 @@ find_barrier (int num_mova, rtx_insn *mova, rtx_insn
*from)
               && GET_CODE (PATTERN (from)) == UNSPEC_VOLATILE
               && XINT (PATTERN (from), 1) == UNSPECV_CONST_END)
        return from;
+      /* get_attr_length might return the length of the original worker
+        for casesi_worker_2.  Get uncached length for it.  */
+      else if (NONJUMP_INSN_P (from)
+              && recog_memoized (from) == CODE_FOR_casesi_worker_2)
+       inc = insn_default_length (from);

       if (BARRIER_P (from))
        {


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (10 preceding siblings ...)
  2015-06-29  5:45 ` kkojima at gcc dot gnu.org
@ 2015-06-29  8:52 ` glaubitz at physik dot fu-berlin.de
  2015-06-29 14:48 ` olegendo at gcc dot gnu.org
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-06-29  8:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #13 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Kazumoto Kojima from comment #12)
> I could reproduce the problem on trunk with '-DXS_VERSION=\"6.89\" -fwrapv
> -fno-strict-aliasing -fopenmp -O2 -fstack-protector-strong -fexceptions
> -fPIC'
> with the cross sh4-unknown-linux-gnu compiler.

Indeed, the bug is still there [1]:

gcc -std=gnu99 -c  -I../ -I.. -I/usr/include/X11 -I/usr/include/freetype2
-I/usr/include/libxml2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -mieee -fwrapv
-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -fopenmp -Wall -g -fno-strict-aliasing -O2 -Wall
-pthread -O2 -g   -DVERSION=\"1.3.20\" -DXS_VERSION=\"1.3.20\" -fPIC
"-I/usr/lib/sh4-linux-gnu/perl/5.20/CORE"  -D_FILE_OFFSET_BITS=64
-D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c
(...)
Magick.c: At top level:
Magick.xs:247:4: warning: 'LogEventTypes' defined but not used
[-Wunused-variable]
   *LogEventTypes[] =
    ^
{standard input}: Assembler messages:
{standard input}:15085: Error: pcrel too far
{standard input}:15086: Error: pcrel too far
make[2]: *** [Magick.o] Error 1

Adrian

> [1] http://buildd.debian-ports.org/status/fetch.php?pkg=graphicsmagick&arch=sh4&ver=1.3.20-3%2Bdeb8u1&stamp=1435541933


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (11 preceding siblings ...)
  2015-06-29  8:52 ` glaubitz at physik dot fu-berlin.de
@ 2015-06-29 14:48 ` olegendo at gcc dot gnu.org
  2015-06-29 23:36 ` kkojima at gcc dot gnu.org
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-06-29 14:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #14 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #12) 
> diff --git a/config/sh/sh.c b/config/sh/sh.c
> index 0139095..86cbea7 100644
> --- a/config/sh/sh.c
> +++ b/config/sh/sh.c
> @@ -5261,6 +5261,11 @@ find_barrier (int num_mova, rtx_insn *mova, rtx_insn
> *from)
>  	       && GET_CODE (PATTERN (from)) == UNSPEC_VOLATILE
>  	       && XINT (PATTERN (from), 1) == UNSPECV_CONST_END)
>  	return from;
> +      /* get_attr_length might return the length of the original worker
> +	 for casesi_worker_2.  Get uncached length for it.  */
> +      else if (NONJUMP_INSN_P (from)
> +	       && recog_memoized (from) == CODE_FOR_casesi_worker_2)
> +	inc = insn_default_length (from);
>  
>        if (BARRIER_P (from))
>  	{

I was trying to understand what's happening there ... it's a bit confusing.  A
cleaner way would probably be to add a function in final.c to update the cached
length value for the INSN_UID in final.c.  Then, invoke that function for the
insn in fixup_mova when the pattern rtx is changed from casesi_worker_1 to
casesi_worker_2.  However, I guess that all the other insn length dependent
values will have to be re-calculated to get a consistent state.

Wouldn't it be easier/safer to just set the length of casesi_worker_1 to "8"?
>From gcc-bugs-return-490966-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jun 29 14:56:50 2015
Return-Path: <gcc-bugs-return-490966-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 38327 invoked by alias); 29 Jun 2015 14:56:49 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 38278 invoked by uid 48); 29 Jun 2015 14:56:44 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/66563] [4.9 Regression] ICE (segmentation fault) on sh4-linux-gnu
Date: Mon, 29 Jun 2015 14:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66563-4-0jdxdZHpoB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66563-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66563-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-06/txt/msg03298.txt.bz2
Content-length: 149

https://gcc.gnu.org/bugzilla/show_bug.cgi?idf563

--- Comment #39 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Can we close this PR as fixed?


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (12 preceding siblings ...)
  2015-06-29 14:48 ` olegendo at gcc dot gnu.org
@ 2015-06-29 23:36 ` kkojima at gcc dot gnu.org
  2015-06-30  0:32 ` kkojima at gcc dot gnu.org
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-06-29 23:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #15 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #14)
> I was trying to understand what's happening there ... it's a bit confusing. 
> A cleaner way would probably be to add a function in final.c to update the
> cached length value for the INSN_UID in final.c.  Then, invoke that function
> for the insn in fixup_mova when the pattern rtx is changed from
> casesi_worker_1 to casesi_worker_2.  However, I guess that all the other
> insn length dependent values will have to be re-calculated to get a
> consistent state.

The usual way to re-compute insn length is shorten_branches.  I'm
not sure that new function is a good idea or not.  It looks a too
big hammer for this corner case on one specific target.
sh_reorg calls shorten_branches after the loop which includes
find_barrier call and get_attr_length will return correct value
after that.
It looks too costly to call shorten_branches for the rare case
in the loop.  I'll look for another point to call shorten_branches
which can fix the issue.

> Wouldn't it be easier/safer to just set the length of casesi_worker_1 to "8"?

It may be safest from the computational viewpoint, though it'll
affect almost existing pic codes, I'm afraid.  Perhaps it's OK
for trunk.  The above patch won't affect existing code except
very limited cases, though it's a bit tricky.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (13 preceding siblings ...)
  2015-06-29 23:36 ` kkojima at gcc dot gnu.org
@ 2015-06-30  0:32 ` kkojima at gcc dot gnu.org
  2015-06-30  2:37 ` olegendo at gcc dot gnu.org
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-06-30  0:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #16 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #15)
> I'll look for another point to call shorten_branches
> which can fix the issue.

OK, I'm giving up on this and now testing the patch below.

diff --git a/config/sh/sh.md b/config/sh/sh.md
index 35113c0..5c8d306 100644
--- a/config/sh/sh.md
+++ b/config/sh/sh.md
@@ -11344,6 +11344,8 @@ label:
     LABEL_NUSES (operands[2])++;
 })

+;; This may be replaced with casesi_worker_2 in sh_reorg for PIC.
+;; The insn length is set to 8 for that case.
 (define_insn "casesi_worker_1"
   [(set (match_operand:SI 0 "register_operand" "=r,r")
        (unspec:SI [(reg:SI R0_REG)
@@ -11375,7 +11377,9 @@ label:
       gcc_unreachable ();
     }
 }
-  [(set_attr "length" "4")])
+  [(set_attr_alternative "length"
+     [(if_then_else (match_test "flag_pic") (const_int 8) (const_int 4))
+      (if_then_else (match_test "flag_pic") (const_int 8) (const_int 4))])])

 (define_insn "casesi_worker_2"
   [(set (match_operand:SI 0 "register_operand" "=r,r")


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (14 preceding siblings ...)
  2015-06-30  0:32 ` kkojima at gcc dot gnu.org
@ 2015-06-30  2:37 ` olegendo at gcc dot gnu.org
  2015-06-30  2:39 ` olegendo at gcc dot gnu.org
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-06-30  2:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #17 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #15)
> sh_reorg calls shorten_branches after the loop which includes
> find_barrier call and get_attr_length will return correct value
> after that.

I see.  If I understand correctly, the computed and cached values in final.c
will not be used by anything else in this case and shorten_branches is always
invoked afterwards.  Now I understand the patch in c#12, thanks.

> > Wouldn't it be easier/safer to just set the length of casesi_worker_1 to "8"?
> 
> It may be safest from the computational viewpoint, though it'll
> affect almost existing pic codes, I'm afraid.  Perhaps it's OK
> for trunk.  The above patch won't affect existing code except
> very limited cases, though it's a bit tricky.

Increasing insn lengths unnecessarily might result in some unlucky constant
pool placements and far branches and some code might get worse.  On the other
hand, constant pool placement and far branch code generation is "a matter of
luck" anyway.  Reading through the sh_reorg code, there are already some
"CODE_FOR_casesi_worker_2" ifs and elses.  Adding one more special case as in
c#12 seems to fit in the picture nicely :)
However, I think the comment in c#12 should be expanded a bit ...

/* get_attr_length returns cached insn lengths which are computed
   once in shorten_branches.  When here, fixup_mova might have replaced
   the insn pattern casesi_worker_1 with casesi_worker_2 and the cached
   insn length will be wrong.  In this case, get the uncached length
   value directly from the insn attribute.  */


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (15 preceding siblings ...)
  2015-06-30  2:37 ` olegendo at gcc dot gnu.org
@ 2015-06-30  2:39 ` olegendo at gcc dot gnu.org
  2015-06-30  3:56 ` kkojima at gcc dot gnu.org
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-06-30  2:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #18 from Oleg Endo <olegendo at gcc dot gnu.org> ---
BTW, in sh_reorg there is...

  label_ref_list_d::pool.release ();
  for (insn = first; insn; insn = NEXT_INSN (insn))
    PUT_MODE (insn, VOIDmode);

  mdep_reorg_phase = SH_SHORTEN_BRANCHES1;
  INSN_ADDRESSES_FREE ();
  split_branches (first);

Kaz, do you know why that PUT_MODE loop above is required?


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (16 preceding siblings ...)
  2015-06-30  2:39 ` olegendo at gcc dot gnu.org
@ 2015-06-30  3:56 ` kkojima at gcc dot gnu.org
  2015-07-01  1:03 ` kkojima at gcc dot gnu.org
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-06-30  3:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #19 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #18)

I don't know how it works, though I've found
https://gcc.gnu.org/ml/gcc-patches/2006-03/msg01108.html


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (17 preceding siblings ...)
  2015-06-30  3:56 ` kkojima at gcc dot gnu.org
@ 2015-07-01  1:03 ` kkojima at gcc dot gnu.org
  2015-07-01 22:01 ` kkojima at gcc dot gnu.org
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-07-01  1:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #21 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
Author: kkojima
Date: Wed Jul  1 01:02:48 2015
New Revision: 225219

URL: https://gcc.gnu.org/viewcvs?rev=225219&root=gcc&view=rev
Log:
PR target/64833
* [SH] Set length of casesi_worker_1 insn to 8 when flag_pic is set.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sh/sh.md


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (18 preceding siblings ...)
  2015-07-01  1:03 ` kkojima at gcc dot gnu.org
@ 2015-07-01 22:01 ` kkojima at gcc dot gnu.org
  2015-07-01 22:05 ` kkojima at gcc dot gnu.org
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-07-01 22:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #22 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
Author: kkojima
Date: Wed Jul  1 22:01:09 2015
New Revision: 225282

URL: https://gcc.gnu.org/viewcvs?rev=225282&root=gcc&view=rev
Log:
PR target/64833
* [SH] Set length of casesi_worker_1 insn to 8 when flag_pic is set.


Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/config/sh/sh.md


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (19 preceding siblings ...)
  2015-07-01 22:01 ` kkojima at gcc dot gnu.org
@ 2015-07-01 22:05 ` kkojima at gcc dot gnu.org
  2015-07-01 22:43 ` kkojima at gcc dot gnu.org
  2015-07-19 15:09 ` glaubitz at physik dot fu-berlin.de
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-07-01 22:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #23 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
Author: kkojima
Date: Wed Jul  1 22:05:09 2015
New Revision: 225283

URL: https://gcc.gnu.org/viewcvs?rev=225283&root=gcc&view=rev
Log:
PR target/64833
* [SH] Set length of casesi_worker_1 insn to 8 when flag_pic is set.


Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/sh/sh.md


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (20 preceding siblings ...)
  2015-07-01 22:05 ` kkojima at gcc dot gnu.org
@ 2015-07-01 22:43 ` kkojima at gcc dot gnu.org
  2015-07-19 15:09 ` glaubitz at physik dot fu-berlin.de
  22 siblings, 0 replies; 24+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-07-01 22:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

Kazumoto Kojima <kkojima at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #24 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Bug target/64833] [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4
  2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
                   ` (21 preceding siblings ...)
  2015-07-01 22:43 ` kkojima at gcc dot gnu.org
@ 2015-07-19 15:09 ` glaubitz at physik dot fu-berlin.de
  22 siblings, 0 replies; 24+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-07-19 15:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64833

--- Comment #25 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Kazumoto Kojima from comment #24)
> Fixed.

Can confirm, graphicsmagick just built successfully for the first time since
2013 :).

> http://buildd.debian-ports.org/status/fetch.php?pkg=graphicsmagick&arch=sh4&ver=1.3.20-3%2Bdeb8u1&stamp=1436877116


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-07-19 15:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 11:50 [Bug c/64833] New: [SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4 glaubitz at physik dot fu-berlin.de
2015-02-15 21:29 ` [Bug c/64833] " olegendo at gcc dot gnu.org
2015-02-15 22:12 ` [Bug target/64833] " olegendo at gcc dot gnu.org
2015-02-15 22:44 ` glaubitz at physik dot fu-berlin.de
2015-02-25 20:12 ` olegendo at gcc dot gnu.org
2015-02-25 20:33 ` glaubitz at physik dot fu-berlin.de
2015-03-15 11:44 ` glaubitz at physik dot fu-berlin.de
2015-06-28 13:18 ` olegendo at gcc dot gnu.org
2015-06-28 15:16 ` glaubitz at physik dot fu-berlin.de
2015-06-28 15:24 ` glaubitz at physik dot fu-berlin.de
2015-06-29  5:07 ` olegendo at gcc dot gnu.org
2015-06-29  5:45 ` kkojima at gcc dot gnu.org
2015-06-29  8:52 ` glaubitz at physik dot fu-berlin.de
2015-06-29 14:48 ` olegendo at gcc dot gnu.org
2015-06-29 23:36 ` kkojima at gcc dot gnu.org
2015-06-30  0:32 ` kkojima at gcc dot gnu.org
2015-06-30  2:37 ` olegendo at gcc dot gnu.org
2015-06-30  2:39 ` olegendo at gcc dot gnu.org
2015-06-30  3:56 ` kkojima at gcc dot gnu.org
2015-07-01  1:03 ` kkojima at gcc dot gnu.org
2015-07-01 22:01 ` kkojima at gcc dot gnu.org
2015-07-01 22:05 ` kkojima at gcc dot gnu.org
2015-07-01 22:43 ` kkojima at gcc dot gnu.org
2015-07-19 15:09 ` glaubitz at physik dot fu-berlin.de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).