public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36881]  New: [4.4 Regression] Creating runtime relocations for code which does not need it
@ 2008-07-20 18:42 pinskia at gcc dot gnu dot org
  2008-07-20 18:43 ` [Bug tree-optimization/36881] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-20 18:42 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

Compile gcc.c-torture/execute/20080719-1.c with -O2 -fPIC and you will get:
gcc/gcc/testsuite/gcc.c-torture/execute/20080719-1.c: In function ‘xxx’:
gcc/gcc/testsuite/gcc.c-torture/execute/20080719-1.c:65: error: creating
run-time relocation for ‘cfb_tab8_be’
gcc/gcc/testsuite/gcc.c-torture/execute/20080719-1.c:65: error: creating
run-time relocation for ‘cfb_tab32’
gcc/gcc/testsuite/gcc.c-torture/execute/20080719-1.c:65: error: creating
run-time relocation for ‘cfb_tab32’

This is because of the switch conversion pass which should be disabled for
-fPIC on spu-elf.  The runtime loader for spu does not currently support
runtime relocations.

If we compile with -O1 -fPIC, these runtime relocations are not created.


-- 
           Summary: [4.4 Regression] Creating runtime relocations for code
                    which does not need it
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: spu-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
@ 2008-07-20 18:43 ` pinskia at gcc dot gnu dot org
  2008-08-08 22:49 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-20 18:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjambor at suse dot cz
   Target Milestone|---                         |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
  2008-07-20 18:43 ` [Bug tree-optimization/36881] " pinskia at gcc dot gnu dot org
@ 2008-08-08 22:49 ` mmitchel at gcc dot gnu dot org
  2008-08-08 22:54 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2008-08-08 22:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
  2008-07-20 18:43 ` [Bug tree-optimization/36881] " pinskia at gcc dot gnu dot org
  2008-08-08 22:49 ` mmitchel at gcc dot gnu dot org
@ 2008-08-08 22:54 ` pinskia at gcc dot gnu dot org
  2008-08-08 23:46 ` mmitchel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-08 22:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-08-08 22:52 -------
This effects more than SPU, for shared libaries, the more runtime relocations
that happen, the slower the load time (usually).  Just for SPU, runtime
relocations are not supported which is why there is error here.  I am going to
change it back to a P3 so Mark can re-decide based on this extra piece of
information. 


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mmitchel at gcc dot gnu dot
                   |                            |org
           Keywords|                            |missed-optimization
           Priority|P5                          |P3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-08-08 22:54 ` pinskia at gcc dot gnu dot org
@ 2008-08-08 23:46 ` mmitchel at gcc dot gnu dot org
  2008-08-09 18:07 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2008-08-08 23:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2008-08-08 23:44 -------
Andrew --

If indeed this is an optimization regression on other platforms, then I agree
that this should be a P2 defect.  Is the optimization problem present on all
platforms with -fPIC?  If not, what's a specific platform where the problem
occurs?  Also, what values are being relocated at run time in the tests case? 
Do you think the compiler should be generating PC-relative addresses for the
tables?  Or that the inliner should be resolving "xxx(8)" to a constant?

Thanks,

-- Mark


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-08-08 23:46 ` mmitchel at gcc dot gnu dot org
@ 2008-08-09 18:07 ` rguenth at gcc dot gnu dot org
  2008-09-04 10:53 ` hubicka at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-08-09 18:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2008-08-09 18:06 -------
Well, the switch conversion pass should create a locally binding (and hidden)
object to store the values.  If it does not then this certainly is a bug.
Though in this case it looks like it needs to build a table of addresses
of non-locally binding objects?  This it shouldn't do by default either I
guess.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-08-09 18:07 ` rguenth at gcc dot gnu dot org
@ 2008-09-04 10:53 ` hubicka at gcc dot gnu dot org
  2008-09-11 11:44 ` jamborm at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2008-09-04 10:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hubicka at gcc dot gnu dot org  2008-09-04 10:52 -------
Ugly -fPIC friendly workaround would be to add runtime initialization.  I.E.

if (!initialized)
 {populate my array; initialized = true;}
that would still allow conversion to happen and generate better code than
expand_switch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-09-04 10:53 ` hubicka at gcc dot gnu dot org
@ 2008-09-11 11:44 ` jamborm at gcc dot gnu dot org
  2008-09-15  9:23 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jamborm at gcc dot gnu dot org @ 2008-09-11 11:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jamborm at gcc dot gnu dot org  2008-09-11 11:42 -------
I guess this is mine.


-- 

jamborm at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jamborm at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-11 11:42:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-09-11 11:44 ` jamborm at gcc dot gnu dot org
@ 2008-09-15  9:23 ` jakub at gcc dot gnu dot org
  2008-10-15  6:46 ` jakub at gcc dot gnu dot org
  2008-10-15  6:50 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-09-15  9:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2008-09-15 09:21 -------
I'd prefer it just to call initializer_constant_valid_p (val, TREE_TYPE (val))
== null_pointer_node for flag_pic (and != NULL_TREE for !flag_pic).  What is in
#c4 would need at least some write after write barriers, would enlarge code too
much and might be worthwhile just in very hot basic blocks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-09-15  9:23 ` jakub at gcc dot gnu dot org
@ 2008-10-15  6:46 ` jakub at gcc dot gnu dot org
  2008-10-15  6:50 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-10-15  6:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2008-10-15 06:44 -------
Subject: Bug 36881

Author: jakub
Date: Wed Oct 15 06:43:19 2008
New Revision: 141129

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141129
Log:
        PR tree-optimization/36881
        * tree-switch-conversion.c (check_final_bb): For flag_pic, check
        that each value doesn't need runtime relocations, for !flag_pic
        check that each value is just a valid initializer constant.

        * gcc.dg/tree-ssa/pr36881.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr36881.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-switch-conversion.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

* [Bug tree-optimization/36881] [4.4 Regression] Creating runtime relocations for code which does not need it
  2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-10-15  6:46 ` jakub at gcc dot gnu dot org
@ 2008-10-15  6:50 ` jakub at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-10-15  6:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2008-10-15 06:48 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36881


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

end of thread, other threads:[~2008-10-15  6:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-20 18:42 [Bug tree-optimization/36881] New: [4.4 Regression] Creating runtime relocations for code which does not need it pinskia at gcc dot gnu dot org
2008-07-20 18:43 ` [Bug tree-optimization/36881] " pinskia at gcc dot gnu dot org
2008-08-08 22:49 ` mmitchel at gcc dot gnu dot org
2008-08-08 22:54 ` pinskia at gcc dot gnu dot org
2008-08-08 23:46 ` mmitchel at gcc dot gnu dot org
2008-08-09 18:07 ` rguenth at gcc dot gnu dot org
2008-09-04 10:53 ` hubicka at gcc dot gnu dot org
2008-09-11 11:44 ` jamborm at gcc dot gnu dot org
2008-09-15  9:23 ` jakub at gcc dot gnu dot org
2008-10-15  6:46 ` jakub at gcc dot gnu dot org
2008-10-15  6:50 ` jakub at gcc dot gnu dot org

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).