commit:     7e8cf8952d62cd178e2d1b252dbd24b37bb8ce62
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 18 22:39:15 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Mar 18 22:39:15 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-patchset.git;a=commit;h=7e8cf895

 Grsec/PaX: 3.0-{3.2.55,3.13.6}-201403172032

---
 3.13.6/0000_README                                 |   2 +-
 ... 4420_grsecurity-3.0-3.13.6-201403172032.patch} | 254 +++++++++++++++++----
 3.2.55/0000_README                                 |   2 +-
 ... 4420_grsecurity-3.0-3.2.55-201403172027.patch} | 247 ++++++++++++++++----
 4 files changed, 422 insertions(+), 83 deletions(-)

diff --git a/3.13.6/0000_README b/3.13.6/0000_README
index 9a10b46..4b2085f 100644
--- a/3.13.6/0000_README
+++ b/3.13.6/0000_README
@@ -2,7 +2,7 @@ README
 -----------------------------------------------------------------------------
 Individual Patch Descriptions:
 -----------------------------------------------------------------------------
-Patch: 4420_grsecurity-3.0-3.13.6-201403142112.patch
+Patch: 4420_grsecurity-3.0-3.13.6-201403172032.patch
 From:  http://www.grsecurity.net
 Desc:  hardened-sources base patch from upstream grsecurity
 

diff --git a/3.13.6/4420_grsecurity-3.0-3.13.6-201403142112.patch 
b/3.13.6/4420_grsecurity-3.0-3.13.6-201403172032.patch
similarity index 99%
rename from 3.13.6/4420_grsecurity-3.0-3.13.6-201403142112.patch
rename to 3.13.6/4420_grsecurity-3.0-3.13.6-201403172032.patch
index 3ef5afe..6142d59 100644
--- a/3.13.6/4420_grsecurity-3.0-3.13.6-201403142112.patch
+++ b/3.13.6/4420_grsecurity-3.0-3.13.6-201403172032.patch
@@ -1845,10 +1845,18 @@ index f94784f..9a09a4a 100644
  extern struct outer_cache_fns outer_cache;
  
 diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
-index 4355f0e..c229913 100644
+index 4355f0e..cd9168e 100644
 --- a/arch/arm/include/asm/page.h
 +++ b/arch/arm/include/asm/page.h
-@@ -114,7 +114,7 @@ struct cpu_user_fns {
+@@ -23,6 +23,7 @@
+ 
+ #else
+ 
++#include <linux/compiler.h>
+ #include <asm/glue.h>
+ 
+ /*
+@@ -114,7 +115,7 @@ struct cpu_user_fns {
        void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
        void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
                        unsigned long vaddr, struct vm_area_struct *vma);
@@ -36913,9 +36921,21 @@ index bc9f43b..29703b8 100644
  static ssize_t show_node_state(struct device *dev,
                               struct device_attribute *attr, char *buf)
 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
-index bfb8955..42c9b9a 100644
+index bfb8955..4ebff34 100644
 --- a/drivers/base/power/domain.c
 +++ b/drivers/base/power/domain.c
+@@ -1809,9 +1809,9 @@ int __pm_genpd_remove_callbacks(struct device *dev, bool 
clear_td)
+ 
+       if (dev->power.subsys_data->domain_data) {
+               gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
+-              gpd_data->ops = (struct gpd_dev_ops){ NULL };
++              memset(&gpd_data->ops, 0, sizeof(gpd_data->ops));
+               if (clear_td)
+-                      gpd_data->td = (struct gpd_timing_data){ 0 };
++                      memset(&gpd_data->td, 0, sizeof(gpd_data->td));
+ 
+               if (--gpd_data->refcount == 0) {
+                       dev->power.subsys_data->domain_data = NULL;
 @@ -1850,7 +1850,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain 
*genpd, int state)
  {
        struct cpuidle_driver *cpuidle_drv;
@@ -39286,6 +39306,19 @@ index 2a90ba6..07f3733 100644
  
        ret = sysfs_create_bin_file(firmware_kobj, &memconsole_bin_attr);
  
+diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
+index ec19036..8ffafc2 100644
+--- a/drivers/gpio/gpio-em.c
++++ b/drivers/gpio/gpio-em.c
+@@ -257,7 +257,7 @@ static int em_gio_probe(struct platform_device *pdev)
+       struct em_gio_priv *p;
+       struct resource *io[2], *irq[2];
+       struct gpio_chip *gpio_chip;
+-      struct irq_chip *irq_chip;
++      irq_chip_no_const *irq_chip;
+       const char *name = dev_name(&pdev->dev);
+       int ret;
+ 
 diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c
 index 814addb..0937d7f 100644
 --- a/drivers/gpio/gpio-ich.c
@@ -39299,6 +39332,19 @@ index 814addb..0937d7f 100644
  
  static struct {
        spinlock_t lock;
+diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c
+index 8b7e719..dc089dc 100644
+--- a/drivers/gpio/gpio-rcar.c
++++ b/drivers/gpio/gpio-rcar.c
+@@ -316,7 +316,7 @@ static int gpio_rcar_probe(struct platform_device *pdev)
+       struct gpio_rcar_priv *p;
+       struct resource *io, *irq;
+       struct gpio_chip *gpio_chip;
+-      struct irq_chip *irq_chip;
++      irq_chip_no_const *irq_chip;
+       const char *name = dev_name(&pdev->dev);
+       int ret;
+ 
 diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
 index 9902732..64b62dd 100644
 --- a/drivers/gpio/gpio-vr41xx.c
@@ -44609,6 +44655,19 @@ index a8c08f3..155fe3d 100644
        INIT_LIST_HEAD(&c->context_list);
  #endif
  
+diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
+index e33e385..28dfd23 100644
+--- a/drivers/mfd/ab8500-debugfs.c
++++ b/drivers/mfd/ab8500-debugfs.c
+@@ -100,7 +100,7 @@ static int irq_last;
+ static u32 *irq_count;
+ static int num_irqs;
+ 
+-static struct device_attribute **dev_attr;
++static device_attribute_no_const **dev_attr;
+ static char **event_name;
+ 
+ static u8 avg_sample = SAMPLE_16;
 diff --git a/drivers/mfd/janz-cmodio.c b/drivers/mfd/janz-cmodio.c
 index fcbb2e9..2635e11 100644
 --- a/drivers/mfd/janz-cmodio.c
@@ -45261,6 +45320,19 @@ index 40e7b1c..6a70fff 100644
        .kind                   = "bond",
        .priv_size              = sizeof(struct bonding),
        .setup                  = bond_setup,
+diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
+index 3c06947..fd0e5de 100644
+--- a/drivers/net/can/Kconfig
++++ b/drivers/net/can/Kconfig
+@@ -104,7 +104,7 @@ config CAN_JANZ_ICAN3
+ 
+ config CAN_FLEXCAN
+       tristate "Support for Freescale FLEXCAN based chips"
+-      depends on ARM || PPC
++      depends on (ARM && CPU_LITTLE_ENDIAN) || PPC
+       ---help---
+         Say Y here if you want to support for Freescale FlexCAN.
+ 
 diff --git a/drivers/net/ethernet/8390/ax88796.c 
b/drivers/net/ethernet/8390/ax88796.c
 index 36fa577..a158806 100644
 --- a/drivers/net/ethernet/8390/ax88796.c
@@ -49187,6 +49259,37 @@ index c0f7cd7..5424212 100644
  
  static struct tty_driver *gdm_driver[TTY_MAX_COUNT];
  static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR];
+diff --git a/drivers/staging/imx-drm/imx-drm-core.c 
b/drivers/staging/imx-drm/imx-drm-core.c
+index 96e4eee..6d7c37e 100644
+--- a/drivers/staging/imx-drm/imx-drm-core.c
++++ b/drivers/staging/imx-drm/imx-drm-core.c
+@@ -510,7 +510,7 @@ int imx_drm_add_crtc(struct drm_crtc *crtc,
+               goto err_busy;
+       }
+ 
+-      if (imxdrm->drm->open_count) {
++      if (local_read(&imxdrm->drm->open_count)) {
+               ret = -EBUSY;
+               goto err_busy;
+       }
+@@ -590,7 +590,7 @@ int imx_drm_add_encoder(struct drm_encoder *encoder,
+ 
+       mutex_lock(&imxdrm->mutex);
+ 
+-      if (imxdrm->drm->open_count) {
++      if (local_read(&imxdrm->drm->open_count)) {
+               ret = -EBUSY;
+               goto err_busy;
+       }
+@@ -729,7 +729,7 @@ int imx_drm_add_connector(struct drm_connector *connector,
+ 
+       mutex_lock(&imxdrm->mutex);
+ 
+-      if (imxdrm->drm->open_count) {
++      if (local_read(&imxdrm->drm->open_count)) {
+               ret = -EBUSY;
+               goto err_busy;
+       }
 diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c 
b/drivers/staging/lustre/lnet/selftest/brw_test.c
 index b7613c8..c302392 100644
 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c
@@ -80063,10 +80166,15 @@ index a224c7f..92d8a97 100644
  /*
   * The PM_EVENT_ messages are also used by drivers implementing the legacy
 diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
-index 7c1d252..c5c773e 100644
+index 7c1d252..0e7061d 100644
 --- a/include/linux/pm_domain.h
 +++ b/include/linux/pm_domain.h
-@@ -48,7 +48,7 @@ struct gpd_dev_ops {
+@@ -44,11 +44,11 @@ struct gpd_dev_ops {
+       int (*thaw_early)(struct device *dev);
+       int (*thaw)(struct device *dev);
+       bool (*active_wakeup)(struct device *dev);
+-};
++} __no_const;
  
  struct gpd_cpu_data {
        unsigned int saved_exit_latency;
@@ -105304,10 +105412,10 @@ index 0000000..4f67ac1
 +}
 diff --git a/tools/gcc/gcc-common.h b/tools/gcc/gcc-common.h
 new file mode 100644
-index 0000000..af12645
+index 0000000..6dbb502
 --- /dev/null
 +++ b/tools/gcc/gcc-common.h
-@@ -0,0 +1,274 @@
+@@ -0,0 +1,286 @@
 +#ifndef GCC_COMMON_H_INCLUDED
 +#define GCC_COMMON_H_INCLUDED
 +
@@ -105368,6 +105476,8 @@ index 0000000..af12645
 +
 +#if BUILDING_GCC_VERSION <= 4008
 +#include "tree-flow.h"
++#else
++#include "tree-cfgcleanup.h"
 +#endif
 +
 +#include "diagnostic.h"
@@ -105407,6 +105517,10 @@ index 0000000..af12645
 +//#include "expr.h" where are you...
 +extern rtx emit_move_insn(rtx x, rtx y);
 +
++// missing from basic_block.h...
++extern void debug_dominance_info(enum cdi_direction dir);
++extern void debug_dominance_tree(enum cdi_direction dir, basic_block root);
++
 +#define __unused __attribute__((__unused__))
 +
 +#define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node))
@@ -105531,6 +105645,12 @@ index 0000000..af12645
 +
 +#if BUILDING_GCC_VERSION <= 4007
 +#define FOR_EACH_VARIABLE(node) for (node = varpool_nodes; node; node = 
node->next)
++#define PROP_loops 0
++
++static inline int bb_loop_depth(const_basic_block bb)
++{
++      return bb->loop_father ? loop_depth(bb->loop_father) : 0;
++}
 +
 +static inline bool gimple_store_p(gimple gs)
 +{
@@ -113493,10 +113613,10 @@ index 0000000..102f0d6
 +nvme_trans_standard_inquiry_page_65526 nvme_trans_standard_inquiry_page 4 
65526 NULL
 diff --git a/tools/gcc/size_overflow_plugin.c 
b/tools/gcc/size_overflow_plugin.c
 new file mode 100644
-index 0000000..4aab36f
+index 0000000..fa0524c
 --- /dev/null
 +++ b/tools/gcc/size_overflow_plugin.c
-@@ -0,0 +1,4051 @@
+@@ -0,0 +1,4101 @@
 +/*
 + * Copyright 2011-2014 by Emese Revfy <[email protected]>
 + * Licensed under the GPL v2, or (at your option) v3
@@ -113512,8 +113632,12 @@ index 0000000..4aab36f
 + * The recomputed argument is checked against TYPE_MAX and an event is logged 
on overflow and the triggering process is killed.
 + *
 + * Usage:
-+ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc 
-print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -o 
size_overflow_plugin.so size_overflow_plugin.c
-+ * $ gcc -fplugin=size_overflow_plugin.so test.c  -O2
++ * $ # for 4.5/4.6/C based 4.7
++ * $ gcc -I`gcc -print-file-name=plugin`/include -I`gcc 
-print-file-name=plugin`/include/c-family -fPIC -shared -O2 -std=gnu99 -ggdb -o 
size_overflow_plugin.so size_overflow_plugin.c
++ * $ # for C++ based 4.7/4.8+
++ * $ g++ -I`g++ -print-file-name=plugin`/include -I`g++ 
-print-file-name=plugin`/include/c-family -fPIC -shared -O2 -std=gnu++98 
-fno-rtti -ggdb -o size_overflow_plugin.so size_overflow_plugin.c
++ *
++ * $ gcc -fplugin=./size_overflow_plugin.so test.c -O2
 + */
 +
 +#include "gcc-common.h"
@@ -113521,7 +113645,7 @@ index 0000000..4aab36f
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info size_overflow_plugin_info = {
-+      .version        = "20140213",
++      .version        = "20140317",
 +      .help           = "no-size-overflow\tturn off size overflow checking\n",
 +};
 +
@@ -113531,8 +113655,6 @@ index 0000000..4aab36f
 +#define CODES_LIMIT 32
 +#define MAX_PARAM 31
 +#define VEC_LEN 128
-+#define MY_STMT GF_PLF_1
-+#define NO_CAST_CHECK GF_PLF_2
 +#define RET_CHECK NULL_TREE
 +#define CANNOT_FIND_ARG 32
 +#define WRONG_NODE 32
@@ -113558,11 +113680,14 @@ index 0000000..4aab36f
 +
 +static unsigned int call_count;
 +
++enum stmt_flags {
++      MY_STMT, NO_CAST_CHECK, VISITED_STMT, NO_FLAGS
++};
++
 +struct visited {
 +      struct visited *next;
 +      const_tree fndecl;
 +      unsigned int num;
-+      const_tree rhs;
 +};
 +
 +struct next_cgraph_node {
@@ -113695,6 +113820,49 @@ index 0000000..4aab36f
 +      register_attribute(&intentional_overflow_attr);
 +}
 +
++static enum stmt_flags get_stmt_flag(gimple stmt)
++{
++      bool bit_1, bit_2;
++
++      bit_1 = gimple_plf(stmt, GF_PLF_1);
++      bit_2 = gimple_plf(stmt, GF_PLF_2);
++
++      if (!bit_1 && !bit_2)
++              return NO_FLAGS;
++      if (bit_1 && bit_2)
++              return MY_STMT;
++      if (!bit_1 && bit_2)
++              return VISITED_STMT;
++      return NO_CAST_CHECK;
++}
++
++static void set_stmt_flag(gimple stmt, enum stmt_flags new_flag)
++{
++      bool bit_1, bit_2;
++
++      switch (new_flag) {
++      case NO_FLAGS:
++              bit_1 = bit_2 = false;
++              break;
++      case MY_STMT:
++              bit_1 = bit_2 = true;
++              break;
++      case VISITED_STMT:
++              bit_1 = false;
++              bit_2 = true;
++              break;
++      case NO_CAST_CHECK:
++              bit_1 = true;
++              bit_2 = false;
++              break;
++      default:
++              gcc_unreachable();
++      }
++
++      gimple_set_plf(stmt, GF_PLF_1, bit_1);
++      gimple_set_plf(stmt, GF_PLF_2, bit_2);
++}
++
 +static bool is_bool(const_tree node)
 +{
 +      const_tree type;
@@ -113982,7 +114150,7 @@ index 0000000..4aab36f
 +
 +      gsi_insert_before(&gsi, assign, GSI_NEW_STMT);
 +      update_stmt(assign);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return assign;
 +}
 +
@@ -114040,7 +114208,7 @@ index 0000000..4aab36f
 +              gcc_unreachable();
 +
 +      def_stmt = get_def_stmt(rhs);
-+      if (def_stmt && gimple_code(def_stmt) != GIMPLE_NOP && 
skip_cast(dst_type, rhs, force) && gimple_plf(def_stmt, MY_STMT))
++      if (def_stmt && gimple_code(def_stmt) != GIMPLE_NOP && 
skip_cast(dst_type, rhs, force) && get_stmt_flag(def_stmt) == MY_STMT)
 +              return def_stmt;
 +
 +      if (lhs == CREATE_NEW_VAR)
@@ -114074,7 +114242,7 @@ index 0000000..4aab36f
 +
 +      gsi = gsi_for_stmt(stmt);
 +      new_stmt = build_cast_stmt(size_overflow_type, rhs, CREATE_NEW_VAR, 
&gsi, before, false);
-+      gimple_set_plf(new_stmt, MY_STMT, true);
++      set_stmt_flag(new_stmt, MY_STMT);
 +
 +      lhs = get_lhs(new_stmt);
 +      gcc_assert(lhs != NULL_TREE);
@@ -114092,7 +114260,7 @@ index 0000000..4aab36f
 +
 +      gsi = gsi_for_stmt(stmt);
 +      cast_stmt = build_cast_stmt(intTI_type_node, node, CREATE_NEW_VAR, 
&gsi, BEFORE_STMT, false);
-+      gimple_set_plf(cast_stmt, MY_STMT, true);
++      set_stmt_flag(cast_stmt, MY_STMT);
 +      return gimple_assign_lhs(cast_stmt);
 +}
 +
@@ -114154,7 +114322,7 @@ index 0000000..4aab36f
 +      gimple_stmt_iterator gsi;
 +      tree size_overflow_type, new_var, lhs = gimple_assign_lhs(oldstmt);
 +
-+      if (gimple_plf(oldstmt, MY_STMT))
++      if (get_stmt_flag(oldstmt) == MY_STMT)
 +              return lhs;
 +
 +      if (gimple_num_ops(oldstmt) != 4 && rhs1 == NULL_TREE) {
@@ -114168,7 +114336,7 @@ index 0000000..4aab36f
 +
 +      stmt = gimple_copy(oldstmt);
 +      gimple_set_location(stmt, gimple_location(oldstmt));
-+      gimple_set_plf(stmt, MY_STMT, true);
++      set_stmt_flag(stmt, MY_STMT);
 +
 +      if (gimple_assign_rhs_code(oldstmt) == WIDEN_MULT_EXPR)
 +              gimple_assign_set_rhs_code(stmt, MULT_EXPR);
@@ -114215,7 +114383,7 @@ index 0000000..4aab36f
 +
 +      gsi = gsi_after_labels(bb);
 +      assign = build_cast_stmt(size_overflow_type, arg, phi_ssa_name, &gsi, 
BEFORE_STMT, false);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +
 +      return gimple_assign_lhs(assign);
 +}
@@ -114233,7 +114401,7 @@ index 0000000..4aab36f
 +              assign = build_cast_stmt(TREE_TYPE(new_arg), new_arg, 
ssa_name_var, &gsi, AFTER_STMT, true);
 +      }
 +
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return gimple_assign_lhs(assign);
 +}
 +
@@ -114250,7 +114418,7 @@ index 0000000..4aab36f
 +      gsi = gsi_after_labels(bb);
 +
 +      assign = build_cast_stmt(size_overflow_type, arg, ssa_name_var, &gsi, 
BEFORE_STMT, false);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return gimple_assign_lhs(assign);
 +}
 +
@@ -114283,7 +114451,7 @@ index 0000000..4aab36f
 +
 +              gsi = gsi_for_stmt(stmt);
 +              assign = build_cast_stmt(size_overflow_type, arg, ssa_name_var, 
&gsi, AFTER_STMT, false);
-+              gimple_set_plf(assign, MY_STMT, true);
++              set_stmt_flag(assign, MY_STMT);
 +              return gimple_assign_lhs(assign);
 +      }
 +      default:
@@ -114318,7 +114486,7 @@ index 0000000..4aab36f
 +      gsi = gsi_for_stmt(oldstmt);
 +      gsi_insert_after(&gsi, phi, GSI_NEW_STMT);
 +      gimple_set_bb(phi, bb);
-+      gimple_set_plf(phi, MY_STMT, true);
++      set_stmt_flag(phi, MY_STMT);
 +      return phi;
 +}
 +
@@ -114411,7 +114579,7 @@ index 0000000..4aab36f
 +      gcc_assert(is_gimple_assign(stmt));
 +
 +      assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, &gsi, 
BEFORE_STMT, false);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return gimple_assign_lhs(assign);
 +}
 +
@@ -114575,7 +114743,7 @@ index 0000000..4aab36f
 +{
 +      tree rhs1, new_rhs1, lhs = gimple_assign_lhs(stmt);
 +
-+      if (gimple_plf(stmt, MY_STMT))
++      if (get_stmt_flag(stmt) == MY_STMT)
 +              return lhs;
 +
 +      rhs1 = gimple_assign_rhs1(stmt);
@@ -114587,7 +114755,7 @@ index 0000000..4aab36f
 +      if (new_rhs1 == NULL_TREE)
 +              return create_cast_assign(visited, stmt);
 +
-+      if (gimple_plf(stmt, NO_CAST_CHECK))
++      if (get_stmt_flag(stmt) == NO_CAST_CHECK)
 +              return dup_assign(visited, stmt, lhs, new_rhs1, NULL_TREE, 
NULL_TREE);
 +
 +      if (gimple_assign_rhs_code(stmt) == BIT_NOT_EXPR) {
@@ -114815,7 +114983,7 @@ index 0000000..4aab36f
 +      def_stmt = get_def_stmt(var);
 +      if (!gimple_assign_cast_p(def_stmt))
 +              return NULL_TREE;
-+      gcc_assert(gimple_code(def_stmt) != GIMPLE_NOP && gimple_plf(def_stmt, 
MY_STMT) && gimple_assign_cast_p(def_stmt));
++      gcc_assert(gimple_code(def_stmt) != GIMPLE_NOP && 
get_stmt_flag(def_stmt) == MY_STMT && gimple_assign_cast_p(def_stmt));
 +
 +      rhs1 = gimple_assign_rhs1(def_stmt);
 +      rhs1_def_stmt = get_def_stmt(rhs1);
@@ -114904,8 +115072,8 @@ index 0000000..4aab36f
 +      if (GET_MODE_BITSIZE(rhs2_def_stmt_rhs1_mode) <= 
GET_MODE_BITSIZE(rhs2_def_stmt_lhs_mode))
 +              return false;
 +
-+      gimple_set_plf(rhs1_def_stmt, NO_CAST_CHECK, true);
-+      gimple_set_plf(rhs2_def_stmt, NO_CAST_CHECK, true);
++      set_stmt_flag(rhs1_def_stmt, NO_CAST_CHECK);
++      set_stmt_flag(rhs2_def_stmt, NO_CAST_CHECK);
 +      return true;
 +}
 +
@@ -115047,7 +115215,7 @@ index 0000000..4aab36f
 +
 +      type = TREE_TYPE(node);
 +
-+      if (gimple_plf(stmt, MY_STMT))
++      if (get_stmt_flag(stmt) == MY_STMT)
 +              return TREE_TYPE(node);
 +
 +      switch (TYPE_MODE(type)) {
@@ -115098,9 +115266,9 @@ index 0000000..4aab36f
 +      gcc_assert(!gsi_end_p(gsi));
 +      next_stmt = gsi_stmt(gsi);
 +
-+      if (gimple_code(def_stmt) == GIMPLE_PHI && 
!gimple_plf((gimple)next_stmt, MY_STMT))
++      if (gimple_code(def_stmt) == GIMPLE_PHI && 
get_stmt_flag((gimple)next_stmt) != MY_STMT)
 +              return NULL_TREE;
-+      gcc_assert(gimple_plf((gimple)next_stmt, MY_STMT));
++      gcc_assert(get_stmt_flag((gimple)next_stmt) == MY_STMT);
 +
 +      return get_lhs(next_stmt);
 +}
@@ -115114,7 +115282,7 @@ index 0000000..4aab36f
 +      if (!def_stmt || gimple_code(def_stmt) == GIMPLE_NOP)
 +              return NULL_TREE;
 +
-+      if (gimple_plf(def_stmt, MY_STMT))
++      if (get_stmt_flag(def_stmt) == MY_STMT)
 +              return lhs;
 +
 +      if (pointer_set_contains(visited, def_stmt))
@@ -116395,7 +116563,6 @@ index 0000000..4aab36f
 +      new_visited = (struct visited *)xmalloc(sizeof(*new_visited));
 +      new_visited->fndecl = cur_node->fndecl;
 +      new_visited->num = cur_node->num;
-+      new_visited->rhs = cur_node->node;
 +      new_visited->next = NULL;
 +
 +      if (!head)
@@ -116415,12 +116582,13 @@ index 0000000..4aab36f
 +      if (!head)
 +              return false;
 +
++      if (get_stmt_flag(cur_node->first_stmt) != VISITED_STMT)
++              return false;
++
 +      for (cur = head; cur; cur = cur->next) {
 +              if (!operand_equal_p(cur_node->fndecl, cur->fndecl, 0))
 +                      continue;
-+              if (cur_node->num != cur->num)
-+                      continue;
-+              if (cur_node->node == cur->rhs)
++              if (cur_node->num == cur->num)
 +                      return true;
 +      }
 +      return false;
@@ -116463,10 +116631,12 @@ index 0000000..4aab36f
 +      call_count = 0;
 +
 +      head = collect_interesting_stmts(next_node);
++
 +      for (cur_node = head; cur_node; cur_node = cur_node->next) {
 +              if (is_visited_function(visited, cur_node))
 +                      continue;
 +              cnodes_head = handle_interesting_stmt(cnodes_head, cur_node, 
node);
++              set_stmt_flag(cur_node->first_stmt, VISITED_STMT);
 +              visited = insert_visited_function(visited, cur_node);
 +      }
 +
@@ -116501,9 +116671,9 @@ index 0000000..4aab36f
 +              gimple_stmt_iterator si;
 +
 +              for (si = gsi_start_bb(bb); !gsi_end_p(si); gsi_next(&si))
-+                      gimple_set_plf(gsi_stmt(si), MY_STMT, false);
++                      set_stmt_flag(gsi_stmt(si), NO_FLAGS);
 +              for (si = gsi_start_phis(bb); !gsi_end_p(si); gsi_next(&si))
-+                      gimple_set_plf(gsi_stmt(si), MY_STMT, false);
++                      set_stmt_flag(gsi_stmt(si), NO_FLAGS);
 +      }
 +}
 +

diff --git a/3.2.55/0000_README b/3.2.55/0000_README
index 14a043a..f880076 100644
--- a/3.2.55/0000_README
+++ b/3.2.55/0000_README
@@ -138,7 +138,7 @@ Patch:      1054_linux-3.2.55.patch
 From:  http://www.kernel.org
 Desc:  Linux 3.2.55
 
-Patch: 4420_grsecurity-3.0-3.2.55-201403142107.patch
+Patch: 4420_grsecurity-3.0-3.2.55-201403172027.patch
 From:  http://www.grsecurity.net
 Desc:  hardened-sources base patch from upstream grsecurity
 

diff --git a/3.2.55/4420_grsecurity-3.0-3.2.55-201403142107.patch 
b/3.2.55/4420_grsecurity-3.0-3.2.55-201403172027.patch
similarity index 99%
rename from 3.2.55/4420_grsecurity-3.0-3.2.55-201403142107.patch
rename to 3.2.55/4420_grsecurity-3.0-3.2.55-201403172027.patch
index bfd99a7..5cd450a 100644
--- a/3.2.55/4420_grsecurity-3.0-3.2.55-201403142107.patch
+++ b/3.2.55/4420_grsecurity-3.0-3.2.55-201403172027.patch
@@ -1689,10 +1689,18 @@ index 53426c6..c7baff3 100644
  #ifdef CONFIG_OUTER_CACHE
  
 diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h
-index ca94653..6ac0d56 100644
+index ca94653..9c398dc 100644
 --- a/arch/arm/include/asm/page.h
 +++ b/arch/arm/include/asm/page.h
-@@ -123,7 +123,7 @@ struct cpu_user_fns {
+@@ -23,6 +23,7 @@
+ 
+ #else
+ 
++#include <linux/compiler.h>
+ #include <asm/glue.h>
+ 
+ /*
+@@ -123,7 +124,7 @@ struct cpu_user_fns {
        void (*cpu_clear_user_highpage)(struct page *page, unsigned long vaddr);
        void (*cpu_copy_user_highpage)(struct page *to, struct page *from,
                        unsigned long vaddr, struct vm_area_struct *vma);
@@ -1713,6 +1721,20 @@ index 3e08fd3..3f14f89 100644
  
  extern pgd_t *pgd_alloc(struct mm_struct *mm);
  extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
+diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
+index 9b419ab..0a91b08 100644
+--- a/arch/arm/include/asm/pgtable.h
++++ b/arch/arm/include/asm/pgtable.h
+@@ -26,6 +26,9 @@
+ 
+ #include <asm/pgtable-2level.h>
+ 
++#define ktla_ktva(addr)               (addr)
++#define ktva_ktla(addr)               (addr)
++
+ /*
+  * Just any arbitrary offset to the start of the vmalloc VM area: the
+  * current 8MB value just means that there will be a 8MB "hole" after the
 diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
 index 96187ff..7a9b049 100644
 --- a/arch/arm/include/asm/ptrace.h
@@ -45948,6 +45970,19 @@ index 2e658d2..46f4afb 100644
  #endif
        { 0x1028, 0x0001, 0x1028, 0x0001, 0, 0, 0 }, /* PERC 2/Si 
(Iguana/PERC2Si) */
        { 0x1028, 0x0002, 0x1028, 0x0002, 0, 0, 1 }, /* PERC 3/Di 
(Opal/PERC3Di) */
+diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
+index bfd618a..bf049f8 100644
+--- a/drivers/scsi/advansys.c
++++ b/drivers/scsi/advansys.c
+@@ -8373,8 +8373,6 @@ static __le32 advansys_get_sense_buffer_dma(struct 
scsi_cmnd *scp)
+       struct asc_board *board = shost_priv(scp->device->host);
+       scp->SCp.dma_handle = dma_map_single(board->dev, scp->sense_buffer,
+                                            SCSI_SENSE_BUFFERSIZE, 
DMA_FROM_DEVICE);
+-      dma_cache_sync(board->dev, scp->sense_buffer,
+-                     SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE);
+       return cpu_to_le32(scp->SCp.dma_handle);
+ }
+ 
 diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c 
b/drivers/scsi/aic7xxx/aic79xx_pci.c
 index 14b5f8d..cc9bd26 100644
 --- a/drivers/scsi/aic7xxx/aic79xx_pci.c
@@ -47170,6 +47205,78 @@ index bafccb3..e3ac78d 100644
  
        /* Ignore return since this msg is optional. */
        rndis_filter_send_request(dev, request);
+diff --git a/drivers/staging/iio/accel/lis3l02dq.h 
b/drivers/staging/iio/accel/lis3l02dq.h
+index 7237a9a..2f83d9d 100644
+--- a/drivers/staging/iio/accel/lis3l02dq.h
++++ b/drivers/staging/iio/accel/lis3l02dq.h
+@@ -158,6 +158,7 @@ struct lis3l02dq_state {
+       struct spi_device               *us;
+       struct iio_trigger              *trig;
+       struct mutex                    buf_lock;
++      int                             gpio;
+       bool                            trigger_on;
+ 
+       u8      tx[LIS3L02DQ_MAX_RX] ____cacheline_aligned;
+diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c 
b/drivers/staging/iio/accel/lis3l02dq_core.c
+index 559545a..92d93d1 100644
+--- a/drivers/staging/iio/accel/lis3l02dq_core.c
++++ b/drivers/staging/iio/accel/lis3l02dq_core.c
+@@ -15,6 +15,7 @@
+ #include <linux/interrupt.h>
+ #include <linux/irq.h>
+ #include <linux/gpio.h>
++#include <linux/of_gpio.h>
+ #include <linux/mutex.h>
+ #include <linux/device.h>
+ #include <linux/kernel.h>
+@@ -678,6 +679,7 @@ static int __devinit lis3l02dq_probe(struct spi_device 
*spi)
+       spi_set_drvdata(spi, indio_dev);
+ 
+       st->us = spi;
++      st->gpio = of_get_gpio(spi->dev.of_node, 0);
+       mutex_init(&st->buf_lock);
+       indio_dev->name = spi->dev.driver->name;
+       indio_dev->dev.parent = &spi->dev;
+@@ -699,7 +701,7 @@ static int __devinit lis3l02dq_probe(struct spi_device 
*spi)
+               goto error_unreg_buffer_funcs;
+       }
+ 
+-      if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0) {
++      if (spi->irq) {
+               ret = request_threaded_irq(st->us->irq,
+                                          &lis3l02dq_th,
+                                          &lis3l02dq_event_handler,
+@@ -729,7 +731,7 @@ error_remove_trigger:
+       if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
+               lis3l02dq_remove_trigger(indio_dev);
+ error_free_interrupt:
+-      if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
++      if (spi->irq)
+               free_irq(st->us->irq, indio_dev);
+ error_uninitialize_buffer:
+       iio_buffer_unregister(indio_dev);
+@@ -784,7 +786,7 @@ static int lis3l02dq_remove(struct spi_device *spi)
+       if (ret)
+               goto err_ret;
+ 
+-      if (spi->irq && gpio_is_valid(irq_to_gpio(spi->irq)) > 0)
++      if (spi->irq)
+               free_irq(st->us->irq, indio_dev);
+ 
+       lis3l02dq_remove_trigger(indio_dev);
+diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c 
b/drivers/staging/iio/accel/lis3l02dq_ring.c
+index 89527af..70d34fc 100644
+--- a/drivers/staging/iio/accel/lis3l02dq_ring.c
++++ b/drivers/staging/iio/accel/lis3l02dq_ring.c
+@@ -292,7 +292,7 @@ static int lis3l02dq_trig_try_reen(struct iio_trigger 
*trig)
+       /* If gpio still high (or high again) */
+       /* In theory possible we will need to do this several times */
+       for (i = 0; i < 5; i++)
+-              if (gpio_get_value(irq_to_gpio(st->us->irq)))
++              if (gpio_get_value(st->gpio))
+                       lis3l02dq_read_all(indio_dev, NULL);
+               else
+                       break;
 diff --git a/drivers/staging/iio/buffer_generic.h 
b/drivers/staging/iio/buffer_generic.h
 index 9e8f010..af9efb56 100644
 --- a/drivers/staging/iio/buffer_generic.h
@@ -108448,10 +108555,10 @@ index 0000000..4f67ac1
 +}
 diff --git a/tools/gcc/gcc-common.h b/tools/gcc/gcc-common.h
 new file mode 100644
-index 0000000..af12645
+index 0000000..6dbb502
 --- /dev/null
 +++ b/tools/gcc/gcc-common.h
-@@ -0,0 +1,274 @@
+@@ -0,0 +1,286 @@
 +#ifndef GCC_COMMON_H_INCLUDED
 +#define GCC_COMMON_H_INCLUDED
 +
@@ -108512,6 +108619,8 @@ index 0000000..af12645
 +
 +#if BUILDING_GCC_VERSION <= 4008
 +#include "tree-flow.h"
++#else
++#include "tree-cfgcleanup.h"
 +#endif
 +
 +#include "diagnostic.h"
@@ -108551,6 +108660,10 @@ index 0000000..af12645
 +//#include "expr.h" where are you...
 +extern rtx emit_move_insn(rtx x, rtx y);
 +
++// missing from basic_block.h...
++extern void debug_dominance_info(enum cdi_direction dir);
++extern void debug_dominance_tree(enum cdi_direction dir, basic_block root);
++
 +#define __unused __attribute__((__unused__))
 +
 +#define DECL_NAME_POINTER(node) IDENTIFIER_POINTER(DECL_NAME(node))
@@ -108675,6 +108788,12 @@ index 0000000..af12645
 +
 +#if BUILDING_GCC_VERSION <= 4007
 +#define FOR_EACH_VARIABLE(node) for (node = varpool_nodes; node; node = 
node->next)
++#define PROP_loops 0
++
++static inline int bb_loop_depth(const_basic_block bb)
++{
++      return bb->loop_father ? loop_depth(bb->loop_father) : 0;
++}
 +
 +static inline bool gimple_store_p(gimple gs)
 +{
@@ -116935,10 +117054,10 @@ index 0000000..7b67f2b
 +selnl_msglen_65499 selnl_msglen 0 65499 NULL
 diff --git a/tools/gcc/size_overflow_plugin.c 
b/tools/gcc/size_overflow_plugin.c
 new file mode 100644
-index 0000000..4aab36f
+index 0000000..fa0524c
 --- /dev/null
 +++ b/tools/gcc/size_overflow_plugin.c
-@@ -0,0 +1,4051 @@
+@@ -0,0 +1,4101 @@
 +/*
 + * Copyright 2011-2014 by Emese Revfy <[email protected]>
 + * Licensed under the GPL v2, or (at your option) v3
@@ -116954,8 +117073,12 @@ index 0000000..4aab36f
 + * The recomputed argument is checked against TYPE_MAX and an event is logged 
on overflow and the triggering process is killed.
 + *
 + * Usage:
-+ * $ gcc -I`gcc -print-file-name=plugin`/include/c-family -I`gcc 
-print-file-name=plugin`/include -fPIC -shared -O2 -ggdb -Wall -W -o 
size_overflow_plugin.so size_overflow_plugin.c
-+ * $ gcc -fplugin=size_overflow_plugin.so test.c  -O2
++ * $ # for 4.5/4.6/C based 4.7
++ * $ gcc -I`gcc -print-file-name=plugin`/include -I`gcc 
-print-file-name=plugin`/include/c-family -fPIC -shared -O2 -std=gnu99 -ggdb -o 
size_overflow_plugin.so size_overflow_plugin.c
++ * $ # for C++ based 4.7/4.8+
++ * $ g++ -I`g++ -print-file-name=plugin`/include -I`g++ 
-print-file-name=plugin`/include/c-family -fPIC -shared -O2 -std=gnu++98 
-fno-rtti -ggdb -o size_overflow_plugin.so size_overflow_plugin.c
++ *
++ * $ gcc -fplugin=./size_overflow_plugin.so test.c -O2
 + */
 +
 +#include "gcc-common.h"
@@ -116963,7 +117086,7 @@ index 0000000..4aab36f
 +int plugin_is_GPL_compatible;
 +
 +static struct plugin_info size_overflow_plugin_info = {
-+      .version        = "20140213",
++      .version        = "20140317",
 +      .help           = "no-size-overflow\tturn off size overflow checking\n",
 +};
 +
@@ -116973,8 +117096,6 @@ index 0000000..4aab36f
 +#define CODES_LIMIT 32
 +#define MAX_PARAM 31
 +#define VEC_LEN 128
-+#define MY_STMT GF_PLF_1
-+#define NO_CAST_CHECK GF_PLF_2
 +#define RET_CHECK NULL_TREE
 +#define CANNOT_FIND_ARG 32
 +#define WRONG_NODE 32
@@ -117000,11 +117121,14 @@ index 0000000..4aab36f
 +
 +static unsigned int call_count;
 +
++enum stmt_flags {
++      MY_STMT, NO_CAST_CHECK, VISITED_STMT, NO_FLAGS
++};
++
 +struct visited {
 +      struct visited *next;
 +      const_tree fndecl;
 +      unsigned int num;
-+      const_tree rhs;
 +};
 +
 +struct next_cgraph_node {
@@ -117137,6 +117261,49 @@ index 0000000..4aab36f
 +      register_attribute(&intentional_overflow_attr);
 +}
 +
++static enum stmt_flags get_stmt_flag(gimple stmt)
++{
++      bool bit_1, bit_2;
++
++      bit_1 = gimple_plf(stmt, GF_PLF_1);
++      bit_2 = gimple_plf(stmt, GF_PLF_2);
++
++      if (!bit_1 && !bit_2)
++              return NO_FLAGS;
++      if (bit_1 && bit_2)
++              return MY_STMT;
++      if (!bit_1 && bit_2)
++              return VISITED_STMT;
++      return NO_CAST_CHECK;
++}
++
++static void set_stmt_flag(gimple stmt, enum stmt_flags new_flag)
++{
++      bool bit_1, bit_2;
++
++      switch (new_flag) {
++      case NO_FLAGS:
++              bit_1 = bit_2 = false;
++              break;
++      case MY_STMT:
++              bit_1 = bit_2 = true;
++              break;
++      case VISITED_STMT:
++              bit_1 = false;
++              bit_2 = true;
++              break;
++      case NO_CAST_CHECK:
++              bit_1 = true;
++              bit_2 = false;
++              break;
++      default:
++              gcc_unreachable();
++      }
++
++      gimple_set_plf(stmt, GF_PLF_1, bit_1);
++      gimple_set_plf(stmt, GF_PLF_2, bit_2);
++}
++
 +static bool is_bool(const_tree node)
 +{
 +      const_tree type;
@@ -117424,7 +117591,7 @@ index 0000000..4aab36f
 +
 +      gsi_insert_before(&gsi, assign, GSI_NEW_STMT);
 +      update_stmt(assign);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return assign;
 +}
 +
@@ -117482,7 +117649,7 @@ index 0000000..4aab36f
 +              gcc_unreachable();
 +
 +      def_stmt = get_def_stmt(rhs);
-+      if (def_stmt && gimple_code(def_stmt) != GIMPLE_NOP && 
skip_cast(dst_type, rhs, force) && gimple_plf(def_stmt, MY_STMT))
++      if (def_stmt && gimple_code(def_stmt) != GIMPLE_NOP && 
skip_cast(dst_type, rhs, force) && get_stmt_flag(def_stmt) == MY_STMT)
 +              return def_stmt;
 +
 +      if (lhs == CREATE_NEW_VAR)
@@ -117516,7 +117683,7 @@ index 0000000..4aab36f
 +
 +      gsi = gsi_for_stmt(stmt);
 +      new_stmt = build_cast_stmt(size_overflow_type, rhs, CREATE_NEW_VAR, 
&gsi, before, false);
-+      gimple_set_plf(new_stmt, MY_STMT, true);
++      set_stmt_flag(new_stmt, MY_STMT);
 +
 +      lhs = get_lhs(new_stmt);
 +      gcc_assert(lhs != NULL_TREE);
@@ -117534,7 +117701,7 @@ index 0000000..4aab36f
 +
 +      gsi = gsi_for_stmt(stmt);
 +      cast_stmt = build_cast_stmt(intTI_type_node, node, CREATE_NEW_VAR, 
&gsi, BEFORE_STMT, false);
-+      gimple_set_plf(cast_stmt, MY_STMT, true);
++      set_stmt_flag(cast_stmt, MY_STMT);
 +      return gimple_assign_lhs(cast_stmt);
 +}
 +
@@ -117596,7 +117763,7 @@ index 0000000..4aab36f
 +      gimple_stmt_iterator gsi;
 +      tree size_overflow_type, new_var, lhs = gimple_assign_lhs(oldstmt);
 +
-+      if (gimple_plf(oldstmt, MY_STMT))
++      if (get_stmt_flag(oldstmt) == MY_STMT)
 +              return lhs;
 +
 +      if (gimple_num_ops(oldstmt) != 4 && rhs1 == NULL_TREE) {
@@ -117610,7 +117777,7 @@ index 0000000..4aab36f
 +
 +      stmt = gimple_copy(oldstmt);
 +      gimple_set_location(stmt, gimple_location(oldstmt));
-+      gimple_set_plf(stmt, MY_STMT, true);
++      set_stmt_flag(stmt, MY_STMT);
 +
 +      if (gimple_assign_rhs_code(oldstmt) == WIDEN_MULT_EXPR)
 +              gimple_assign_set_rhs_code(stmt, MULT_EXPR);
@@ -117657,7 +117824,7 @@ index 0000000..4aab36f
 +
 +      gsi = gsi_after_labels(bb);
 +      assign = build_cast_stmt(size_overflow_type, arg, phi_ssa_name, &gsi, 
BEFORE_STMT, false);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +
 +      return gimple_assign_lhs(assign);
 +}
@@ -117675,7 +117842,7 @@ index 0000000..4aab36f
 +              assign = build_cast_stmt(TREE_TYPE(new_arg), new_arg, 
ssa_name_var, &gsi, AFTER_STMT, true);
 +      }
 +
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return gimple_assign_lhs(assign);
 +}
 +
@@ -117692,7 +117859,7 @@ index 0000000..4aab36f
 +      gsi = gsi_after_labels(bb);
 +
 +      assign = build_cast_stmt(size_overflow_type, arg, ssa_name_var, &gsi, 
BEFORE_STMT, false);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return gimple_assign_lhs(assign);
 +}
 +
@@ -117725,7 +117892,7 @@ index 0000000..4aab36f
 +
 +              gsi = gsi_for_stmt(stmt);
 +              assign = build_cast_stmt(size_overflow_type, arg, ssa_name_var, 
&gsi, AFTER_STMT, false);
-+              gimple_set_plf(assign, MY_STMT, true);
++              set_stmt_flag(assign, MY_STMT);
 +              return gimple_assign_lhs(assign);
 +      }
 +      default:
@@ -117760,7 +117927,7 @@ index 0000000..4aab36f
 +      gsi = gsi_for_stmt(oldstmt);
 +      gsi_insert_after(&gsi, phi, GSI_NEW_STMT);
 +      gimple_set_bb(phi, bb);
-+      gimple_set_plf(phi, MY_STMT, true);
++      set_stmt_flag(phi, MY_STMT);
 +      return phi;
 +}
 +
@@ -117853,7 +118020,7 @@ index 0000000..4aab36f
 +      gcc_assert(is_gimple_assign(stmt));
 +
 +      assign = build_cast_stmt(origtype, new_rhs, CREATE_NEW_VAR, &gsi, 
BEFORE_STMT, false);
-+      gimple_set_plf(assign, MY_STMT, true);
++      set_stmt_flag(assign, MY_STMT);
 +      return gimple_assign_lhs(assign);
 +}
 +
@@ -118017,7 +118184,7 @@ index 0000000..4aab36f
 +{
 +      tree rhs1, new_rhs1, lhs = gimple_assign_lhs(stmt);
 +
-+      if (gimple_plf(stmt, MY_STMT))
++      if (get_stmt_flag(stmt) == MY_STMT)
 +              return lhs;
 +
 +      rhs1 = gimple_assign_rhs1(stmt);
@@ -118029,7 +118196,7 @@ index 0000000..4aab36f
 +      if (new_rhs1 == NULL_TREE)
 +              return create_cast_assign(visited, stmt);
 +
-+      if (gimple_plf(stmt, NO_CAST_CHECK))
++      if (get_stmt_flag(stmt) == NO_CAST_CHECK)
 +              return dup_assign(visited, stmt, lhs, new_rhs1, NULL_TREE, 
NULL_TREE);
 +
 +      if (gimple_assign_rhs_code(stmt) == BIT_NOT_EXPR) {
@@ -118257,7 +118424,7 @@ index 0000000..4aab36f
 +      def_stmt = get_def_stmt(var);
 +      if (!gimple_assign_cast_p(def_stmt))
 +              return NULL_TREE;
-+      gcc_assert(gimple_code(def_stmt) != GIMPLE_NOP && gimple_plf(def_stmt, 
MY_STMT) && gimple_assign_cast_p(def_stmt));
++      gcc_assert(gimple_code(def_stmt) != GIMPLE_NOP && 
get_stmt_flag(def_stmt) == MY_STMT && gimple_assign_cast_p(def_stmt));
 +
 +      rhs1 = gimple_assign_rhs1(def_stmt);
 +      rhs1_def_stmt = get_def_stmt(rhs1);
@@ -118346,8 +118513,8 @@ index 0000000..4aab36f
 +      if (GET_MODE_BITSIZE(rhs2_def_stmt_rhs1_mode) <= 
GET_MODE_BITSIZE(rhs2_def_stmt_lhs_mode))
 +              return false;
 +
-+      gimple_set_plf(rhs1_def_stmt, NO_CAST_CHECK, true);
-+      gimple_set_plf(rhs2_def_stmt, NO_CAST_CHECK, true);
++      set_stmt_flag(rhs1_def_stmt, NO_CAST_CHECK);
++      set_stmt_flag(rhs2_def_stmt, NO_CAST_CHECK);
 +      return true;
 +}
 +
@@ -118489,7 +118656,7 @@ index 0000000..4aab36f
 +
 +      type = TREE_TYPE(node);
 +
-+      if (gimple_plf(stmt, MY_STMT))
++      if (get_stmt_flag(stmt) == MY_STMT)
 +              return TREE_TYPE(node);
 +
 +      switch (TYPE_MODE(type)) {
@@ -118540,9 +118707,9 @@ index 0000000..4aab36f
 +      gcc_assert(!gsi_end_p(gsi));
 +      next_stmt = gsi_stmt(gsi);
 +
-+      if (gimple_code(def_stmt) == GIMPLE_PHI && 
!gimple_plf((gimple)next_stmt, MY_STMT))
++      if (gimple_code(def_stmt) == GIMPLE_PHI && 
get_stmt_flag((gimple)next_stmt) != MY_STMT)
 +              return NULL_TREE;
-+      gcc_assert(gimple_plf((gimple)next_stmt, MY_STMT));
++      gcc_assert(get_stmt_flag((gimple)next_stmt) == MY_STMT);
 +
 +      return get_lhs(next_stmt);
 +}
@@ -118556,7 +118723,7 @@ index 0000000..4aab36f
 +      if (!def_stmt || gimple_code(def_stmt) == GIMPLE_NOP)
 +              return NULL_TREE;
 +
-+      if (gimple_plf(def_stmt, MY_STMT))
++      if (get_stmt_flag(def_stmt) == MY_STMT)
 +              return lhs;
 +
 +      if (pointer_set_contains(visited, def_stmt))
@@ -119837,7 +120004,6 @@ index 0000000..4aab36f
 +      new_visited = (struct visited *)xmalloc(sizeof(*new_visited));
 +      new_visited->fndecl = cur_node->fndecl;
 +      new_visited->num = cur_node->num;
-+      new_visited->rhs = cur_node->node;
 +      new_visited->next = NULL;
 +
 +      if (!head)
@@ -119857,12 +120023,13 @@ index 0000000..4aab36f
 +      if (!head)
 +              return false;
 +
++      if (get_stmt_flag(cur_node->first_stmt) != VISITED_STMT)
++              return false;
++
 +      for (cur = head; cur; cur = cur->next) {
 +              if (!operand_equal_p(cur_node->fndecl, cur->fndecl, 0))
 +                      continue;
-+              if (cur_node->num != cur->num)
-+                      continue;
-+              if (cur_node->node == cur->rhs)
++              if (cur_node->num == cur->num)
 +                      return true;
 +      }
 +      return false;
@@ -119905,10 +120072,12 @@ index 0000000..4aab36f
 +      call_count = 0;
 +
 +      head = collect_interesting_stmts(next_node);
++
 +      for (cur_node = head; cur_node; cur_node = cur_node->next) {
 +              if (is_visited_function(visited, cur_node))
 +                      continue;
 +              cnodes_head = handle_interesting_stmt(cnodes_head, cur_node, 
node);
++              set_stmt_flag(cur_node->first_stmt, VISITED_STMT);
 +              visited = insert_visited_function(visited, cur_node);
 +      }
 +
@@ -119943,9 +120112,9 @@ index 0000000..4aab36f
 +              gimple_stmt_iterator si;
 +
 +              for (si = gsi_start_bb(bb); !gsi_end_p(si); gsi_next(&si))
-+                      gimple_set_plf(gsi_stmt(si), MY_STMT, false);
++                      set_stmt_flag(gsi_stmt(si), NO_FLAGS);
 +              for (si = gsi_start_phis(bb); !gsi_end_p(si); gsi_next(&si))
-+                      gimple_set_plf(gsi_stmt(si), MY_STMT, false);
++                      set_stmt_flag(gsi_stmt(si), NO_FLAGS);
 +      }
 +}
 +

Reply via email to