source: patches/gcc-4.1.0-PR26763-1.patch@ f2d3163

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since f2d3163 was 4fc5a87, checked in by Jim Gifford <clfs@…>, 19 years ago

Added GCC multilib patch. Rename fold_const patch to PR # to keep consistency

  • Property mode set to 100644
File size: 3.1 KB
  • ChangeLog

    Submitted By: Jim Gifford (patches at jg555 dot com)
    Date: 2006-04-17
    Initial Package Version: 4.1.0
    Origin: Maintainers
    Upstream Status: Fixed in SVN
    Description: 
    Fixes an optimization error that can result incorrectly code. See PR's below
    
    Issues in CLFS book, this patch fixes the incorrect disk checksums in silo.
    
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27176
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26763
     
    diff -Naur gcc-4.1.0.orig/ChangeLog gcc-4.1.0/ChangeLog
    old new  
     12006-04-05  Richard Guenther  <rguenther@suse.de>
     2
     3        PR tree-optimization/26763
     4        * fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
     5        only for EQ_EXPR and NE_EXPR.
     6
     7        * gcc.dg/torture/pr26763-1.c: New testcase.
     8        * gcc.dg/torture/pr26763-2.c: Likewise.
     9
    1102006-02-28  Release Manager
    211
    312        * GCC 4.1.0 released.
  • gcc/fold-const.c

    diff -Naur gcc-4.1.0.orig/gcc/fold-const.c gcc-4.1.0/gcc/fold-const.c
    old new  
    88978897
    88988898      /* If this is a comparison of two exprs that look like an
    88998899         ARRAY_REF of the same object, then we can fold this to a
    8900          comparison of the two offsets.  */
    8901       if (TREE_CODE_CLASS (code) == tcc_comparison)
     8900         comparison of the two offsets.  This is only safe for
     8901         EQ_EXPR and NE_EXPR because of overflow issues.  */
     8902      if (code == EQ_EXPR || code == NE_EXPR)
    89028903        {
    89038904          tree base0, offset0, base1, offset1;
    89048905
  • gcc/testsuite/ChangeLog

    diff -Naur gcc-4.1.0.orig/gcc/testsuite/ChangeLog gcc-4.1.0/gcc/testsuite/ChangeLog
    old new  
     12006-04-05  Richard Guenther  <rguenther@suse.de>
     2
     3        PR tree-optimization/26763
     4        * fold-const.c (fold_binary): Fold PTR + CST CMP PTR + CST
     5        only for EQ_EXPR and NE_EXPR.
     6
     7        * gcc.dg/torture/pr26763-1.c: New testcase.
     8        * gcc.dg/torture/pr26763-2.c: Likewise.
     9
    1102006-02-28  Release Manager
    211
    312        * GCC 4.1.0 released.
  • gcc/testsuite/gcc.dg/pr26763-1.ch

    diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-1.ch gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-1.ch
    old new  
     1/* { dg-do run } */
     2
     3extern void abort(void);
     4
     5int try (int *a)
     6{
     7  return a + -1 > a;
     8}
     9
     10int main(void)
     11{
     12  int bla[100];
     13
     14  if (try (bla + 50))
     15    abort ();
     16
     17  return 0;
     18}
  • gcc/testsuite/gcc.dg/pr26763-2.c

    diff -Naur gcc-4.1.0.orig/gcc/testsuite/gcc.dg/pr26763-2.c gcc-4.1.0/gcc/testsuite/gcc.dg/pr26763-2.c
    old new  
     1/* { dg-do run } */
     2
     3extern void abort(void);
     4
     5int try (char *a, int d)
     6{
     7  return a + d > a;
     8}
     9
     10int main(void)
     11{
     12  char bla[100];
     13
     14  if (try (bla + 50, -1))
     15    abort ();
     16
     17  return 0;
     18}
Note: See TracBrowser for help on using the repository browser.