public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/23523] New: code size regression on x86
@ 2005-08-23 5:45 dann at godzilla dot ics dot uci dot edu
2005-08-23 5:53 ` [Bug rtl-optimization/23523] " dann at godzilla dot ics dot uci dot edu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-23 5:45 UTC (permalink / raw)
To: gcc-bugs
Compiling the code in the main.i attachment with -march=i686 -O2 the code
generated for the "first_map_occurred" is bigger for 4.1 compared to 4.0
The sdiff between 4.0 and 4.1:
xorl %eax, %eax | xorl %ecx, %ecx
movl %eax, waiting_for_initial_map | movl %ecx, waiting_for_initial_map
Trying to minimize the testcase changes the code generated for 4.1
It is a bit worse.
typedef struct {
int max_col;
int max_row;
} TScreen;
typedef struct _XtermWidgetRec {
TScreen screen;
} XtermWidgetRec, *XtermWidget;
static int cp_pipe[2];
static int pc_pipe[2];
typedef enum {
PTY_BAD,
PTY_FATALERROR,
PTY_GOOD,
PTY_NEW,
PTY_NOMORE,
UTMP_ADDED,
UTMP_TTYSLOT,
PTY_EXEC
} status_t;
typedef struct {
status_t status;
int error;
int fatal_error;
int tty_slot;
int rows;
int cols;
char buffer[1024];
} handshake_t;
extern XtermWidget term;
extern int waiting_for_initial_map;
__extension__ typedef int __ssize_t;
typedef __ssize_t ssize_t;
typedef unsigned int size_t;
extern ssize_t write (int __fd, __const void *__buf, size_t __n) ;
extern int close (int __fd);
void
first_map_occurred(void)
{
handshake_t handshake;
TScreen *screen = &term->screen;
handshake.status = PTY_EXEC;
handshake.rows = screen->max_row;
handshake.cols = screen->max_col;
write(pc_pipe[1], (char *) &handshake, sizeof(handshake));
close(cp_pipe[0]);
close(pc_pipe[1]);
waiting_for_initial_map = 0;
}
This is one of the reasons for the code size regression in PR23153.
--
Summary: code size regression on x86
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dann at godzilla dot ics dot uci dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23523
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/23523] code size regression on x86
2005-08-23 5:45 [Bug rtl-optimization/23523] New: code size regression on x86 dann at godzilla dot ics dot uci dot edu
@ 2005-08-23 5:53 ` dann at godzilla dot ics dot uci dot edu
2005-08-23 11:28 ` pinskia at gcc dot gnu dot org
2005-08-25 6:02 ` dann at godzilla dot ics dot uci dot edu
2 siblings, 0 replies; 4+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-23 5:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2005-08-23 05:45 -------
Created an attachment (id=9559)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9559&action=view)
preprocessed source, look for "first_map_occurred"
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23523
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/23523] code size regression on x86
2005-08-23 5:45 [Bug rtl-optimization/23523] New: code size regression on x86 dann at godzilla dot ics dot uci dot edu
2005-08-23 5:53 ` [Bug rtl-optimization/23523] " dann at godzilla dot ics dot uci dot edu
@ 2005-08-23 11:28 ` pinskia at gcc dot gnu dot org
2005-08-25 6:02 ` dann at godzilla dot ics dot uci dot edu
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-23 11:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-23 11:26 -------
This is an ra issue. There is only one load from pc_pipe[1] which x86 does not like. There is an
actually a different on the tree level but the ra should have handled that but it does not.
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |18427
Severity|normal |minor
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |missed-optimization, ra
Last reconfirmed|0000-00-00 00:00:00 |2005-08-23 11:26:01
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23523
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug rtl-optimization/23523] code size regression on x86
2005-08-23 5:45 [Bug rtl-optimization/23523] New: code size regression on x86 dann at godzilla dot ics dot uci dot edu
2005-08-23 5:53 ` [Bug rtl-optimization/23523] " dann at godzilla dot ics dot uci dot edu
2005-08-23 11:28 ` pinskia at gcc dot gnu dot org
@ 2005-08-25 6:02 ` dann at godzilla dot ics dot uci dot edu
2 siblings, 0 replies; 4+ messages in thread
From: dann at godzilla dot ics dot uci dot edu @ 2005-08-25 6:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2005-08-25 05:43 -------
The issue is the peephole2 pass in 4.1. Before it the insn looks like:
(insn:HI 36 34 37 0 (set (mem/i:SI (symbol_ref:SI ("waiting_for_initial_map")
[flags 0x40] <var_decl 0xb7b71898 waiting_for_initial_map>) [7
waiting_for_initial_map+0 S4 A32])
(const_int 0 [0x0])) 34 {*movsi_1} (nil)
(nil))
and after:
(insn 58 34 59 0 (parallel [
(set (reg:SI 2 cx)
(const_int 0 [0x0]))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
(insn 59 58 37 0 (set (mem/i:SI (symbol_ref:SI ("waiting_for_initial_map")
[flags 0x40] <var_decl 0xb7b71898 waiting_for_initial_map>) [7
waiting_for_initial_map+0 S4 A32])
(reg:SI 2 cx)) -1 (nil)
(expr_list:REG_DEAD (reg:SI 2 cx)
(nil)))
4.0 uses "ax" instead of "cx". %eax is free at that point, so it is strange that
it's not used in 4.1
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn|18427 |
OtherBugsDependingO| |23153
nThis| |
Keywords|ra |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23523
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-08-25 5:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-23 5:45 [Bug rtl-optimization/23523] New: code size regression on x86 dann at godzilla dot ics dot uci dot edu
2005-08-23 5:53 ` [Bug rtl-optimization/23523] " dann at godzilla dot ics dot uci dot edu
2005-08-23 11:28 ` pinskia at gcc dot gnu dot org
2005-08-25 6:02 ` dann at godzilla dot ics dot uci dot edu
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).