[Bug rtl-optimization/24376] wrong-code unless -fno-sched-interblock

2006-01-10 Thread seidl at feld dot cvut dot cz


--- Comment #7 from seidl at feld dot cvut dot cz  2006-01-11 01:24 ---
Hi Nick,
I tested patched compiler on my problematic sources and I check assembler
output of compiler carefully (but not execute destination code yet). I believe
that reported problem is solved. But the compilation of several other sources
is break by internal compiler error in schedule_block referencing at
sched-rgn.c:2572 or haifa-sched.c:2355.
I send you two selected problematic sources including command line and compiler
response in attachment for analyse. But, the compilation of internal gcc
library gcc-3.4.4/gcc/libgcc2.c is affected by the internal error also,
compilation of cross-compiler ends with error:
 My commandline for cross-compiler make:
../gcc-3.4.4/configure --prefix=/usr/local/v850 --host=i586-pc-linux-gnu\
 --target=v850-linux-elf --program-suffix=.v
nice make -s
 and the error response at end of compilation:
../../gcc-3.4.4/gcc/libgcc2.c: In function `__addvdi3':
../../gcc-3.4.4/gcc/libgcc2.c:109: internal compiler error: in schedule_block,
at haifa-sched.c:2355

I thank you for your help. I presume, that the error resolving is important for
other platform that v850 (may be for any platform with cc0 ?) and may impact
the wide quantity of GCC users. But your first patch has unneded side effect in
internal compiler errors and I ask you kindly for continue of the problem
elimination.

Regards
Libor


-- 


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




[Bug rtl-optimization/24376] wrong-code unless -fno-sched-interblock

2006-01-10 Thread seidl at feld dot cvut dot cz


--- Comment #8 from seidl at feld dot cvut dot cz  2006-01-11 01:26 ---
Created an attachment (id=10616)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10616&action=view)
Source generating internal error of patched compiler


-- 


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




[Bug rtl-optimization/24376] wrong-code unless -fno-sched-interblock

2006-01-10 Thread seidl at feld dot cvut dot cz


--- Comment #9 from seidl at feld dot cvut dot cz  2006-01-11 01:30 ---
Created an attachment (id=10617)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10617&action=view)
Another source making internal error of patched compiler


-- 


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




[Bug rtl-optimization/24376] wrong-code unless -fno-sched-interblock

2006-01-12 Thread seidl at feld dot cvut dot cz


--- Comment #12 from seidl at feld dot cvut dot cz  2006-01-13 02:11 ---
(In reply to comment #11)
Hi Nick,
the patched compiler works OK and cross-compiled program in target v850
platform seems to be functional and stable. I assume, the problem is solved,
but I plane to make a thorough program functionality tests in next days. I will
inform you about result of the tests in next week, but I hope that the problem
is solved. Thank you for your help and for GCC maintenance.
Cheers
   Libor


-- 


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



[Bug c/24376] New: wrong-code unless -fno-sched-interblock

2005-10-14 Thread seidl at feld dot cvut dot cz
The cross-compiler gcc-3.4.4 (or 3.4.3) for v850 generates wrong-code for
example source bug2.c (see below).
The cmp instruction in expression (ps1 ? 1 : 2) was lost in the first
scheduling pass (see dump-file bug2.c.23.sched generated by compilation with
-da option). The return value of sh_dir() (see below) is random and depends on
state of PSW register at return from previous bprintf() call.

Shorted asm listing of wrong-code:
...
jarl _x_bprintf,r31 #
setf z,r10  # tmp73
add 1,r10   #, 
...

The wrong-code may be work-arounded by -fno-sched-interblock option.
The good-code - shorted asm listing:
...
jarl _x_bprintf,r31 #
cmp r0,r28  # ps   <---(This is the lost instruction)
setf z,r10  # tmp73
add 1,r10   #, 
...


The problem was tested on several linux instalation (Redhat 7.2 on i686, RedHat
Enterprise release 4 on x86_64, ...).

The source file bug2.c follows:
/*/
#define NULL 0

extern const char *f_cwd(const char *s);
extern int x_strcmp(const char *s1, const char *s2);
extern int x_strncmp(const char *s1, const char *s2, unsigned n);
extern int x_bprintf(int f, const char *fmt, ...);


typedef struct
{
  char cline[202];
  unsigned char out;
  unsigned short dir;
} t_sloc;


int sh_dir(t_sloc *sl)
{
  const char *ps=NULL, *ps1;

  if (x_strcmp(sl->cline, "pwd") == 0)
goto label01;

  if (x_strncmp(sl->cline, "cd ", 3) == 0 && sl->cline[3] > ' ') {
ps = sl->cline + 3;
label01:
if ((ps1 = ps = f_cwd(ps)) == NULL)
  ps = f_cwd(NULL);
if (!ps)
  return 2;

x_bprintf(sl->out, "wd: %s\r\n", ps);
sl->dir = ps[1] != 'M';
x_bprintf(1, "ps1=%p, %d\r\n", ps1, 2);

/* This occurs wrong code: The state of Z flag of PSW register (cc0)
 * at end of previous call x_bprintf()
 * is evaluated instead of ps1 in next line. */

return ps1 ? 1 : 2;
  }

  return 0;
}
/* End of source file*/
/*/


The compiler command line:
/usr/local/bin/gcc.v -Wall -Os -mspace -ep -mghs -mno-app-regs -mzda=8 -c
-Wa,-a=bug2.lst -fverbose-asm -o bug2.o bug2.c

The cross-compiler configure line:
../gcc-3.4.4/configure --prefix=/usr/local/ --host=i586-pc-linux-gnu
--target=v850-linux-elf --program-suffix=.v


-- 
   Summary: wrong-code unless -fno-sched-interblock
   Product: gcc
   Version: 3.4.4
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: c
    AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: seidl at feld dot cvut dot cz
 GCC build triplet: i586-pc-linux-gnu
  GCC host triplet: i586-pc-linux-gnu
GCC target triplet: v850-linux-elf


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



[Bug c/24376] wrong-code unless -fno-sched-interblock

2005-10-14 Thread seidl at feld dot cvut dot cz


--- Comment #1 from seidl at feld dot cvut dot cz  2005-10-14 21:52 ---
Created an attachment (id=9987)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9987&action=view)
source code for wrong-code problem demonstration


-- 


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



[Bug rtl-optimization/24376] wrong-code unless -fno-sched-interblock

2006-01-29 Thread seidl at feld dot cvut dot cz


--- Comment #13 from seidl at feld dot cvut dot cz  2006-01-30 00:00 ---
Hi Nick,
I tested the pathed compiler nearly two weaks. I not detect any problem or any
side-effect. Therefore, the bug seems to be fixed reliably. The patch is usable
and needful for next version gcc-3.4.5 too (I test it successfully). Thank you
for your maintenance of GCC.
Regards
Libor


-- 

seidl at feld dot cvut dot cz changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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